This is an automated email from the ASF dual-hosted git repository.

chenhang pushed a commit to branch branch-4.15
in repository https://gitbox.apache.org/repos/asf/bookkeeper.git


The following commit(s) were added to refs/heads/branch-4.15 by this push:
     new f5872c1db6 [Branch-4.15] Fix ReadOnlyLedgerHandle leak issue when 
checkAllLedgers (#4470)
f5872c1db6 is described below

commit f5872c1db6d0111f3f8964dd67cffc758cc17399
Author: Yan Zhao <[email protected]>
AuthorDate: Mon Aug 5 17:39:02 2024 +0800

    [Branch-4.15] Fix ReadOnlyLedgerHandle leak issue when checkAllLedgers 
(#4470)
    
    * Fix ReadOnlyLedgerHandle leak issue when checkAllLedgers.
    
    * fix: install netcat-openbsd instead of netcat in test image build (#4476)
    
    Signed-off-by: ZhangJian He <[email protected]>
    (cherry picked from commit 56625245d53ce37525fc3f8eb4f3274beecf52eb)
    
    ---------
    
    Co-authored-by: ZhangJian He <[email protected]>
---
 .../src/main/java/org/apache/bookkeeper/replication/Auditor.java         | 1 +
 1 file changed, 1 insertion(+)

diff --git 
a/bookkeeper-server/src/main/java/org/apache/bookkeeper/replication/Auditor.java
 
b/bookkeeper-server/src/main/java/org/apache/bookkeeper/replication/Auditor.java
index ad14e2c23e..cbd609d959 100644
--- 
a/bookkeeper-server/src/main/java/org/apache/bookkeeper/replication/Auditor.java
+++ 
b/bookkeeper-server/src/main/java/org/apache/bookkeeper/replication/Auditor.java
@@ -1348,6 +1348,7 @@ public class Auditor implements AutoCloseable {
                             
numFragmentsPerLedger.registerSuccessfulValue(lh.getNumFragments());
                             
numBookiesPerLedger.registerSuccessfulValue(lh.getNumBookies());
                             numLedgersChecked.inc();
+                            lh.closeAsync();
                         });
                     } else if 
(Code.NoSuchLedgerExistsOnMetadataServerException == rc) {
                         if (LOG.isDebugEnabled()) {

Reply via email to