sijie commented on a change in pull request #214: Fix ByteBuf refcount release URL: https://github.com/apache/bookkeeper/pull/214#discussion_r124899962
########## File path: bookkeeper-server/src/main/java/org/apache/bookkeeper/proto/BookieProtoEncoding.java ########## @@ -155,9 +155,8 @@ public Object decode(ByteBuf packet) // Read ledger and entry id without advancing the reader index ledgerId = packet.getLong(packet.readerIndex()); entryId = packet.getLong(packet.readerIndex() + 8); - return new BookieProtocol.AddRequest(version, ledgerId, entryId, flags, masterKey, packet.retain()); + return new BookieProtocol.AddRequest(version, ledgerId, entryId, flags, masterKey, packet); Review comment: I believe the retain here is necessary. because the add request will go through multiple I/O component, we can only release the buffer when the add operation is completed. ---------------------------------------------------------------- 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: us...@infra.apache.org With regards, Apache Git Services