AndrewJSchofield commented on code in PR #15234:
URL: https://github.com/apache/kafka/pull/15234#discussion_r1459379766


##########
server/src/main/java/org/apache/kafka/server/ClientMetricsManager.java:
##########
@@ -433,4 +459,26 @@ public Map<String, Pattern> matchPattern() {
             return matchPattern;
         }
     }
+
+    private final class ExpirationTimerTask extends TimerTask {
+
+        private final Uuid uuid;
+
+        private ExpirationTimerTask(Uuid uuid, long delayMs) {
+            super(delayMs);
+            this.uuid = uuid;
+        }
+
+        @Override
+        public void run() {
+            log.trace("Expiration timer task run for client instance id: {}, 
after delay ms: {}", uuid, delayMs);
+            if (!clientInstanceCache.remove(uuid)) {
+                // This can only happen if the client instance is removed from 
the cache by the LRU
+                // eviction policy before the expiration timer task is 
executed. Log a warning as broker
+                // cache is not able to hold all the client instances.
+                log.warn("Client metrics instance cache cannot find the client 
instance id: {}. The cache"

Review Comment:
   Or even emit the log line no more than once every 10 seconds, including a 
count of how many times it has occurred since the last message.



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