dao-jun commented on code in PR #23831:
URL: https://github.com/apache/pulsar/pull/23831#discussion_r1909739020
##########
pulsar-broker/src/main/java/org/apache/pulsar/PulsarClusterMetadataTeardown.java:
##########
@@ -222,9 +222,19 @@ private static void deleteLedger(BookKeeper bookKeeper,
long ledgerId) {
if (log.isDebugEnabled()) {
log.debug("Delete ledger id: {}", ledgerId);
}
- } catch (InterruptedException | BKException e) {
- log.error("Failed to delete ledger {}: {}", ledgerId, e);
- throw new RuntimeException(e);
+ } catch (InterruptedException | BKException ex) {
+ if (ex instanceof BKException bkException) {
+ switch (bkException.getCode()) {
+ case BKException.Code.NoSuchLedgerExistsException:
+ case
BKException.Code.NoSuchLedgerExistsOnMetadataServerException:
+ case BKException.Code.NoSuchEntryException:
Review Comment:
LGTM, but why to catch `NoSuchEntryException ` ?
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]