codelipenghui commented on a change in pull request #5942: Avoid using same 
OpAddEntry between different ledger handles
URL: https://github.com/apache/pulsar/pull/5942#discussion_r362360670
 
 

 ##########
 File path: 
managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedLedgerImpl.java
 ##########
 @@ -1294,9 +1293,24 @@ public synchronized void updateLedgersIdsComplete(Stat 
stat) {
             log.debug("[{}] Resending {} pending messages", name, 
pendingAddEntries.size());
         }
 
+        // Avoid use same OpAddEntry between different ledger handle
+        int pendingSize = pendingAddEntries.size();
 
 Review comment:
   The pendingAddEntries is ConcurrentLinkedQueue, there is no drainTo method 
in ConcurrentLinkedQueue, maybe we can use pendingAddEntries.toArray() and then 
create a new OpAddEntry for each item of the array and add the new entry to an 
intermediate list.

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to