You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2022/01/12 07:26:43 UTC
[GitHub] [pulsar] codelipenghui commented on a change in pull request #13596: [Broker] Add operation timeout to metadata store
codelipenghui commented on a change in pull request #13596:
URL: https://github.com/apache/pulsar/pull/13596#discussion_r782771994
##########
File path: pulsar-metadata/src/main/java/org/apache/pulsar/metadata/impl/ZKMetadataStore.java
##########
@@ -186,6 +188,12 @@ protected void batchOperation(List<MetadataOp> ops) {
}
}
}, null);
+
+ executor.schedule(() -> {
+ if (!callback.get()) {
+ ops.forEach(n -> n.getFuture().completeExceptionally(new TimeoutException()));
+ }
+ }, getMetadataStoreConfig().getOperationTimeoutSeconds(), TimeUnit.SECONDS);
Review comment:
I think we don't need to change here? The batch operation just groups a few ops to one batch, each single ops has a future and if the caller requires an operation timeout, the caller can only use `future.get(timeout)`?
--
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