dlg99 commented on code in PR #4293:
URL: https://github.com/apache/bookkeeper/pull/4293#discussion_r1585179589
##########
bookkeeper-server/src/main/java/org/apache/bookkeeper/proto/BookieClientImpl.java:
##########
@@ -407,14 +409,16 @@ static ChannelReadyForAddEntryCallback create(
@Override
public void operationComplete(final int rc,
PerChannelBookieClient pcbc) {
- if (rc != BKException.Code.OK) {
- bookieClient.completeAdd(rc, ledgerId, entryId, addr, cb, ctx);
- } else {
- pcbc.addEntry(ledgerId, masterKey, entryId,
- toSend, cb, ctx, options, allowFastFail,
writeFlags);
+ try {
+ if (rc != BKException.Code.OK) {
+ bookieClient.completeAdd(rc, ledgerId, entryId, addr, cb,
ctx);
+ } else {
+ pcbc.addEntry(ledgerId, masterKey, entryId,
+ toSend, cb, ctx, options, allowFastFail,
writeFlags);
+ }
+ } finally {
+ ReferenceCountUtil.release(toSend);
}
-
- ReferenceCountUtil.release(toSend);
recycle();
Review Comment:
should the `recycle()` also be in the `finally` block?
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]