apoorvmittal10 commented on code in PR #15251:
URL: https://github.com/apache/kafka/pull/15251#discussion_r1469845294


##########
server/src/main/java/org/apache/kafka/server/ClientMetricsManager.java:
##########
@@ -288,6 +307,9 @@ private ClientMetricsInstance 
createClientInstanceAndUpdateCache(Uuid clientInst
         ClientMetricsInstanceMetadata instanceMetadata) {
 
         ClientMetricsInstance clientInstance = 
createClientInstance(clientInstanceId, instanceMetadata);
+        // Maybe add client metrics, if metrics not already added. Metrics 
might be already added
+        // if the client instance was evicted from the cache because of size 
limit.

Review Comment:
   The only place where we do not do that is when LRU cache eviction happens 
because of size which practically shouldn't happen but have added a safe check 
so we do not get duplicate metric registration error.



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