horizonzy commented on code in PR #21028: URL: https://github.com/apache/pulsar/pull/21028#discussion_r1299291930
########## pulsar-metadata/src/main/java/org/apache/pulsar/metadata/bookkeeper/PulsarLedgerUnderreplicationManager.java: ########## @@ -392,12 +397,13 @@ public void markLedgerReplicated(long ledgerId) throws ReplicationException.Unav try { Lock l = heldLocks.get(ledgerId); if (l != null) { - store.delete(getUrLedgerPath(ledgerId), Optional.of(l.getLedgerNodeVersion())).get(); + store.delete(getUrLedgerPath(ledgerId), Optional.of(l.getLedgerNodeVersion())) + .get(BLOCKING_CALL_TIMEOUT, MILLISECONDS); } - } catch (ExecutionException ee) { - if (ee.getCause() instanceof MetadataStoreException.NotFoundException) { + } catch (ExecutionException | TimeoutException ee) { + if (ee.getCause() != null && ee.getCause() instanceof MetadataStoreException.NotFoundException) { Review Comment: If we need to check the cause from the Exception, we can catch `TimeoutException` separately, then no need the check for `ee.getCause() != null`. -- 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-unsubscr...@pulsar.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org