lhotari commented on pull request #9308:
URL: https://github.com/apache/pulsar/pull/9308#issuecomment-806471852


   @eolivelli I have made the change to closeAsync so that it doesn't throw 
checked exceptions. 
   
   I took another look at MessagingServiceShutdownHook logic and unfortunately 
I didn't find a way to simplify the logic. There the intention is to run the 
shutdown in a background thread so that the actual shutdown can continue if the 
shutdown takes longer than the timeout. Although the code might look bad, there 
isn't a real alternative. Catching Exceptions is necessary to catch also 
possible runtime exceptions that could happen at shutdown. You can try to 
suggest a better way, I tried and simply didn't find one. :) 


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

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to