You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by "coderzc (via GitHub)" <gi...@apache.org> on 2023/08/20 05:16:23 UTC
[GitHub] [pulsar] coderzc commented on a diff in pull request #21028: [improve][meta] Improve fault tolerance of blocking calls by supporting timeout
coderzc commented on code in PR #21028:
URL: https://github.com/apache/pulsar/pull/21028#discussion_r1299301462
##########
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:
+1
--
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-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org