You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2021/01/13 06:33:14 UTC

[GitHub] [pulsar] aloyszhang commented on a change in pull request #9194: fix memory leak

aloyszhang commented on a change in pull request #9194:
URL: https://github.com/apache/pulsar/pull/9194#discussion_r556290656



##########
File path: pulsar-broker/src/main/java/org/apache/pulsar/broker/intercept/ManagedLedgerInterceptorImpl.java
##########
@@ -81,10 +81,11 @@ public void onManagedLedgerPropertiesInitialize(Map<String, String> propertiesMa
 
     @Override
     public void onManagedLedgerLastLedgerInitialize(String name, LedgerHandle lh) {
+        LedgerEntries ledgerEntries = null;
         try {
             for (BrokerEntryMetadataInterceptor interceptor : brokerEntryMetadataInterceptors) {
                 if (interceptor instanceof AppendIndexMetadataInterceptor && lh.getLastAddConfirmed() >= 0) {
-                    LedgerEntries ledgerEntries =
+                    ledgerEntries =

Review comment:
       There will be only on `AppendIndexMetadataInterceptor` for each `ManagedLedger`




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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org