gaodayue opened a new pull request #6402: Thread-safe QueryMetrics
URL: https://github.com/apache/incubator-druid/pull/6402
 
 
   Fixes #4826 and #5128 
   
   It should be easy to use QueryMetrics from different threads for scenario 
like JDBC. The doc says "DefaultQueryMetrics's ownerThread should be reassigned 
explicitly", but it is not clear how best to do that.
   
   I propose to make QueryMetrics thread safe so that it could be used in 
different threads with minimum effort. One case directly benefiting from the 
design is that the [yielderOpenCloseExecutor hack](#4415) could be removed. It 
also solves the above issues instantly.
   
   leventov has pointed out one drawback of making QueryMetrics thread-safe
   
   > making QueryMetrics thread-safe is inherently wrong thing to do. Instead 
of failing with ConcurrentModificationException, multiple threads will override 
metrics of each other. Nobody would understand what is going on and if the 
metrics are trustworthy or not.
   
   I think it's still a valid concern. But this thread-safe approach indeed 
makes every other things simpler and simple code could also mean fewer bugs. 
   
   @leventov @gianm @jon-wei what do you think?

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to