mgodave opened a new pull request #1355: Remove as many Thread.sleep calls from 
REST endpoint
URL: https://github.com/apache/incubator-pulsar/pull/1355
 
 
   Thread.sleep is rarely the correct answer as it can lead to race conditions 
and incorrect results. In this case sleeping the tread will tie up an entire 
thread in the REST endpoint. The operations that are being slept are themselves 
async and can easily be represented as Futures (CompletableFutures). 
Furthermore the REST framework we are using supports async results. This has 
the benefit of still allowing timeouts on the endpoint, allowing an operation 
to fail or complete, and not tie up an entire serving thread while an already 
async operation completes. There is still one remaining Thread.sleep that I 
would like to squash but I wanted to put this work up for consideration.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to