poorbarcode commented on code in PR #18340:
URL: https://github.com/apache/pulsar/pull/18340#discussion_r1014937387
##########
managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedCursorImpl.java:
##########
@@ -2707,6 +2707,26 @@ public void operationFailed(ManagedLedgerException
exception) {
});
}
+ /**
+ * Try set {@link #state} to {@link State#Closing}.
+ * @return false if the {@link #state} already is {@link State#Closing} or
{@link State#Closed}.
+ */
+ private boolean trySetStateToClosing() {
+ if (STATE_UPDATER.compareAndSet(this, State.Uninitialized,
State.Closing)){
Review Comment:
Thanks, this is a really good way to deal with this problem.
already fixed
--
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]