This is an automated email from the ASF dual-hosted git repository.
technoboy pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pulsar.git
The following commit(s) were added to refs/heads/master by this push:
new a8f22d85a19 [fix][ml] Fix unfinished callback when deleting managed
ledger (#21530)
a8f22d85a19 is described below
commit a8f22d85a196f874afb16d5a6ea08155814b4ddf
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 47d0d77734c..51c5c91234f 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
@@ -837,7 +837,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;
});
}