chia7712 commented on PR #13285:
URL: https://github.com/apache/kafka/pull/13285#issuecomment-1443786837

   @divijvaidya thanks for feedback!  
   
   >  However, the processors are stored in an ArrayBuffer which is mutable.
   
   pardon me. the mutable ArrayBuffer won't be modified after it is created. It 
seems to me the "mutable" won't hurt us here.
   
   > If we remove this lock, the processors will be accessed in a thread unsafe 
manner. Isn't that right?
   
   All we need to update metrics is the `metricTags` of processor. we won't 
update `metricTags` after processor is created. It seems to me it is 
thread-safe after we get collection copy from `ConcurrentHashMap` as the 
collection copy and `metricTags` won't get changed anymore. Also, we have 
`Option` to handle null metrics if the processor is removed by anther thread.


-- 
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: jira-unsubscr...@kafka.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to