ivankelly commented on a change in pull request #1221: Refactored ReadResponse 
ref count handling
URL: https://github.com/apache/bookkeeper/pull/1221#discussion_r171510819
 
 

 ##########
 File path: 
bookkeeper-server/src/main/java/org/apache/bookkeeper/client/PendingReadOp.java
 ##########
 @@ -589,12 +588,15 @@ public void readEntryComplete(int rc, long ledgerId, 
final long entryId, final B
         heardFromHosts.add(rctx.to);
         heardFromHostsBitSet.set(rctx.bookieIndex, true);
 
+        buffer.retain();
 
 Review comment:
   We pass it into entry#complete, if entry#complete accepts the buffer, it 
gets passed to entryImpl.setEntryBuf, which takes ownership, and entry#complete 
returns true, otherwise it returns false, and it gets cleaned up in the else 
branch. entryImpls either get passed to the client (which is then responsible 
for cleanup), or cleaned up in submitCallback L637.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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