You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2022/06/08 07:34:06 UTC

[GitHub] [pulsar] eolivelli commented on a diff in pull request #15971: [ML] When skipping updating mark delete position, execute callback with executor to prevent deadlock

eolivelli commented on code in PR #15971:
URL: https://github.com/apache/pulsar/pull/15971#discussion_r892017626


##########
managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedCursorImpl.java:
##########
@@ -1896,7 +1896,8 @@ void internalMarkDelete(final MarkDeleteEntry mdEntry) {
                 log.info("Skipping updating mark delete position to {}. The persisted mark delete position {} "
                         + "is later.", mdEntry.newPosition, persistentMarkDeletePosition);
             }
-            mdEntry.triggerComplete();
+            // run with executor to prevent deadlock
+            ledger.getExecutor().executeOrdered(ledger.getName(), safeRun(() -> mdEntry.triggerComplete()));

Review Comment:
   I think that this behaviour is consistent with what happens a few lines below in the operationComplete() callback passed to `persistPositionToLedger`:` mdEntry.triggerComplete();` is not executed on this thread immediately but later



-- 
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: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org