Skip to content

Commit

Permalink
[improve][broker] Propagate cause exception in TopicBusyException whe…
Browse files Browse the repository at this point in the history
…n applicable (apache#22596)

(cherry picked from commit 3b9602c)
  • Loading branch information
lhotari committed Apr 26, 2024
1 parent 701d4cf commit d00d715
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,10 @@ public static class TopicBusyException extends BrokerServiceException {
public TopicBusyException(String msg) {
super(msg);
}

public TopicBusyException(String msg, Throwable t) {
super(msg, t);
}
}

public static class TopicNotFoundException extends BrokerServiceException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,8 @@ private CompletableFuture<Void> delete(boolean failIfHasSubscriptions, boolean c
}
}).exceptionally(ex -> {
deleteFuture.completeExceptionally(
new TopicBusyException("Failed to close clients before deleting topic."));
new TopicBusyException("Failed to close clients before deleting topic.",
FutureUtil.unwrapCompletionException(ex)));
return null;
});
} finally {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1442,7 +1442,8 @@ public void deleteLedgerComplete(Object ctx) {
}).exceptionally(ex->{
unfenceTopicToResume();
deleteFuture.completeExceptionally(
new TopicBusyException("Failed to close clients before deleting topic."));
new TopicBusyException("Failed to close clients before deleting topic.",
FutureUtil.unwrapCompletionException(ex)));
return null;
});

Expand Down

0 comments on commit d00d715

Please sign in to comment.