kfaraz commented on PR #13034:
URL: https://github.com/apache/druid/pull/13034#issuecomment-1240339747

   The changes look good. I have some concerns about thread-safety though. The 
`Metrics` object or the map of `registeredMetrics` inside it is not 
thread-safe. Every invocation of `emit` updates the map of registered which is 
being read by `flush` on a different thread. So it's possible that the metric 
map gets updated by an `emit` event while a `flush` event is still reading from 
the map, thus sending a metric packet with inconsistent values.
   
   I am not sure it would be a good idea to block `emit` while `flush` is going 
on either.
   
   @599166320 , @FrankChen021 , what do you think?


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

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


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

Reply via email to