zhaizhibo commented on PR #25240: URL: https://github.com/apache/pulsar/pull/25240#issuecomment-3884760128
> ## Pull request overview > > This PR addresses `pendingAddEntries` leaks in `ManagedLedgerImpl` when the managed ledger transitions to `Closed` or `Fenced` while there are queued add operations that were never initiated. > > **Changes:** > - Add `OpAddEntry.closeIfNotInitiated()` and use it to fail/remove queued-but-not-initiated add operations on close/fence. > - Schedule the post-rollover metadata-update completion to run on the managed ledger executor thread. > - Clear pending writes when `ledgerClosed()` is invoked while in `Fenced` state. > > ### Reviewed changes > > Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments. > > | File | Description | > | ---- | ----------- | > | managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/OpAddEntry.java | Adds a helper to atomically close an `OpAddEntry` if it has not been initiated. | > | managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedLedgerImpl.java | Adds selective clearing of not-initiated pending adds on close/fence and adjusts rollover callback execution/threading and fenced handling. | > > > > > > --- > > 💡 <a href="/apache/pulsar/new/master/.github/instructions?filename=*.instructions.md" class="Link--inTextBlock" target="_blank" rel="noopener noreferrer">Add Copilot custom instructions</a> for smarter, more guided reviews. <a href="https://docs.github.com/en/copilot/customizing-copilot/adding-repository-custom-instructions-for-github-copilot" class="Link--inTextBlock" target="_blank" rel="noopener noreferrer">Learn how to get started</a>. Fixed -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
