lucasbru opened a new pull request, #20262:
URL: https://github.com/apache/kafka/pull/20262

   All state updater threads use the same metrics instance, but do not use 
unique names for their sensors. This can have the following symptoms:
   
   1) Data inserted into one sensor by one thread can affect the metrics of all 
state updater threads. 
   2) If one state updater thread is shutdown, the metrics associated to all 
state updater threads are removed.
   3) If one state updater thread is started, while another one is removed, it 
can happen that a metric is registered with the `Metrics` instance, but not 
associated to any `Sensor` (because it is concurrently removed), which means 
that the metric will not be removed upon shutdown. If a thread with the same 
name later tries to register the same metric, we may run into a 
`java.lang.IllegalArgumentException: A metric named ... already exists`, as 
described in the ticket.
   
   This change fixes the bug giving unique names to the sensors. A test is 
added that there is no interference of the removal of sensors and metrics 
during shutdown.


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

Reply via email to