poorbarcode commented on code in PR #20303:
URL: https://github.com/apache/pulsar/pull/20303#discussion_r1197342482


##########
pulsar-metadata/src/main/java/org/apache/pulsar/metadata/impl/AbstractMetadataStore.java:
##########
@@ -528,7 +528,7 @@ public void execute(Runnable task, CompletableFuture<?> 
future) {
         try {
             executor.execute(task);
         } catch (Throwable t) {
-            future.completeExceptionally(t);
+            executor.execute(() -> future.completeExceptionally(t));

Review Comment:
   >> Now, if we call `put /a`, it will use the `event thread` of the ZK client 
after the operation; but if we call `put /a/b/c`(the node `/a` is not exists), 
it will use the `metadata store thread` after the operation.
   
   > What is the consequence of using different threads? Did you see out of 
order events?
   > EDIT: looks like the consequence is this error `ZooKeeper session 
reconnection timeout. Notifying session is lost`.
   
   To easier to trace the context, I answer this question here.
   
   No, I notice this when I check for deadlocks 
https://github.com/apache/pulsar/pull/20189. I saw that the ZK thread was 
executing the task of creating the topic. And then I realized that maybe 
@merlimat  forgot to change this.



-- 
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

Reply via email to