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 08:02:59 UTC

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

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


##########
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:
   Yes, it happened in a different thread that will not hold the `pendingMarkDeleteOps` lock, so will not encounter the deadlock.



-- 
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