AnonHxy commented on code in PR #19825:
URL: https://github.com/apache/pulsar/pull/19825#discussion_r1142085094
##########
managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/MetaStoreImpl.java:
##########
@@ -301,11 +302,16 @@ public void asyncRemoveCursor(String ledgerName, String
cursorName, MetaStoreCal
}
callback.operationComplete(null, null);
}, executor.chooseThread(ledgerName))
- .exceptionally(ex -> {
- executor.executeOrdered(ledgerName,
SafeRunnable.safeRun(() -> callback
- .operationFailed(getException(ex))));
+ .exceptionallyAsync(ex -> {
+ Throwable actEx = FutureUtil.unwrapCompletionException(ex);
+ if (actEx instanceof
MetadataStoreException.NotFoundException){
+ log.info("[{}] [{}] cursor delete done because it did
not exist.", ledgerName, cursorName);
+ callback.operationComplete(null, null);
Review Comment:
I wonder what's the affect if callbalck fail when the race condition happens.
I found that if we complete the callback here, the line1407 maybe fail and
retry because the `cursorLedger` will not exist
https://github.com/apache/pulsar/blob/5d2d61e298e337b93fb178da191bc41d311107c2/managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedLedgerImpl.java#L1044-L1048
--
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]