bharanic-dev commented on pull request #12930:
URL: https://github.com/apache/pulsar/pull/12930#issuecomment-987149372


   @pkumar-singh, please see:
   
   https://github.com/apache/pulsar/pull/12930#discussion_r758845818
   
   the callback executor is single-threaded. Let's say there is some code like 
below:
   getTopicMetadata().thenAccept (x -> do_something(x));
   
   do_something() gets executed in the executor thread. If do_something makes a 
blocking call to the metadata-store, the callback for that blocking call will 
never gets executed because the callback executor is blocked (waiting for 
do_something() to finish).
   
   The fix is to make sure that the callback executor doesn't get blocked. So, 
changing the "thenAccept" to "thenAccetpAsync", which makes the callback 
executor just schedule the callback to a different executor, the deadlock is 
avoided.
   
   Hope that explains the issue and the fix.


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