You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "chia7712 (via GitHub)" <gi...@apache.org> on 2023/02/24 14:46:48 UTC

[GitHub] [kafka] chia7712 commented on pull request #13285: KAFKA-13874 Avoid synchronization in SocketServer metrics

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-unsubscribe@kafka.apache.org

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