hangc0276 commented on code in PR #3672:
URL: https://github.com/apache/bookkeeper/pull/3672#discussion_r1033053183


##########
bookkeeper-server/src/main/java/org/apache/bookkeeper/client/ReadOnlyLedgerHandle.java:
##########
@@ -326,11 +326,15 @@ CompletableFuture<Versioned<LedgerMetadata>> 
closeRecovered() {
                     return 
builder.withClosedState().withLastEntryId(lac).withLength(len).build();
                 },
                 this::setLedgerMetadata).run();
-        f.thenRun(() -> {
-                synchronized (metadataLock) {
-                    newEnsemblesFromRecovery.clear();
-                }
-            });
+        f.whenComplete((result, exception) -> {
+            synchronized (metadataLock) {
+                newEnsemblesFromRecovery.clear();
+            }
+            if (exception != null) {

Review Comment:
   The exception has been catched in the outside logic, and where is the memory 
leak?



-- 
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]

Reply via email to