This is an automated email from the ASF dual-hosted git repository.
chenhang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/bookkeeper.git
The following commit(s) were added to refs/heads/master by this push:
new 999cd0f2ab Fix ReadOnlyLedgerHandle leak issue when checkAllLedgers.
(#4468)
999cd0f2ab is described below
commit 999cd0f2ab14404be4d6c24e388456dbe56bb1a8
Author: Yan Zhao <[email protected]>
AuthorDate: Wed Jul 31 11:16:58 2024 +0800
Fix ReadOnlyLedgerHandle leak issue when checkAllLedgers. (#4468)
When the Auditor checkAllledgers, it will open the ledger with NoRecovery
mode, it will register the listeners to the AbstractZkLedgerManager#listeners.
The listener won't be removed if we don't close the ReadOnlyLedgerHandle,
so there will be lots of listeners in the heap memory.
The heap dump:
<img width="1572" alt="image"
src="https://github.com/user-attachments/assets/8b4cd6d3-b7bf-4ef2-9c47-2e076bdbbba0">
---
.../org/apache/bookkeeper/replication/AuditorCheckAllLedgersTask.java | 1 +
1 file changed, 1 insertion(+)
diff --git
a/bookkeeper-server/src/main/java/org/apache/bookkeeper/replication/AuditorCheckAllLedgersTask.java
b/bookkeeper-server/src/main/java/org/apache/bookkeeper/replication/AuditorCheckAllLedgersTask.java
index 299d47a281..261ccf7fe2 100644
---
a/bookkeeper-server/src/main/java/org/apache/bookkeeper/replication/AuditorCheckAllLedgersTask.java
+++
b/bookkeeper-server/src/main/java/org/apache/bookkeeper/replication/AuditorCheckAllLedgersTask.java
@@ -211,6 +211,7 @@ public class AuditorCheckAllLedgersTask extends AuditorTask
{
auditorStats.getNumFragmentsPerLedger().registerSuccessfulValue(lh.getNumFragments());
auditorStats.getNumBookiesPerLedger().registerSuccessfulValue(lh.getNumBookies());
auditorStats.getNumLedgersChecked().inc();
+ lh.closeAsync();
});
} else if
(BKException.Code.NoSuchLedgerExistsOnMetadataServerException == rc) {
if (LOG.isDebugEnabled()) {