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/06/01 18:05:24 UTC

[GitHub] [pulsar] sijie commented on a change in pull request #10773: [ML] Release OpAddEntry.data when entry is copied and discarded

sijie commented on a change in pull request #10773:
URL: https://github.com/apache/pulsar/pull/10773#discussion_r643370185



##########
File path: managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedLedgerImpl.java
##########
@@ -1504,6 +1504,8 @@ public synchronized void updateLedgersIdsComplete(Stat stat) {
                 if (existsOp.ledger != null) {
                     existsOp.close();
                     existsOp = OpAddEntry.create(existsOp.ml, existsOp.data, existsOp.getNumberOfMessages(), existsOp.callback, existsOp.ctx);
+                    // release the extra retain
+                    ReferenceCountUtil.release(existsOp.data);

Review comment:
       Just one question, doesn't `existsOp.close` release the reference? Or can you clarify (potentially comment in the code) why do we need to release extra retain here?




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