lhotari commented on code in PR #22221:
URL: https://github.com/apache/pulsar/pull/22221#discussion_r1565183246
##########
managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/OpAddEntry.java:
##########
@@ -375,6 +398,13 @@ protected OpAddEntry newObject(Recycler.Handle<OpAddEntry>
recyclerHandle) {
}
};
+ public void recycleAfterClosed() {
+ if (STATE_UPDATER.get(this) != State.CLOSED) {
+ recycle();
+ }
+ closeFuture.thenAccept(ignore -> recycle());
+ }
Review Comment:
I think that there might be a better way to address this using reference
counting. Another alternative is to skip recycling in cases where there's a
potential issue. Recycling is not mandatory.
--
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]