This is an automated email from the ASF dual-hosted git repository.

technoboy pushed a commit to branch branch-3.0
in repository https://gitbox.apache.org/repos/asf/pulsar.git


The following commit(s) were added to refs/heads/branch-3.0 by this push:
     new e79cf45b30c [fix][ml] Fix unfinished callback when deleting managed 
ledger (#21530)
e79cf45b30c is described below

commit e79cf45b30cc378e091e62abaeee27c287f261d0
Author: Qiang Zhao <[email protected]>
AuthorDate: Fri Nov 10 19:14:39 2023 +0800

    [fix][ml] Fix unfinished callback when deleting managed ledger (#21530)
---
 .../org/apache/bookkeeper/mledger/impl/ManagedLedgerFactoryImpl.java | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git 
a/managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedLedgerFactoryImpl.java
 
b/managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedLedgerFactoryImpl.java
index cabd70ce427..85144ba1231 100644
--- 
a/managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedLedgerFactoryImpl.java
+++ 
b/managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedLedgerFactoryImpl.java
@@ -879,7 +879,10 @@ public class ManagedLedgerFactoryImpl implements 
ManagedLedgerFactory {
                 // If it's open, delete in the normal way
                 ml.asyncDelete(callback, ctx);
             }).exceptionally(ex -> {
-                // If it's failing to get open, just delete from metadata
+                // If it fails to get open, it will be cleaned by managed 
ledger opening error handling.
+                // then retry will go to `future=null` branch.
+                final Throwable rc = FutureUtil.unwrapCompletionException(ex);
+                callback.deleteLedgerFailed(getManagedLedgerException(rc), 
ctx);
                 return null;
             });
         }

Reply via email to