apoorvmittal10 commented on code in PR #15234:
URL: https://github.com/apache/kafka/pull/15234#discussion_r1461065097
##########
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:
I have added the frequency check where log shall only appear once in 5
minutes to notify the error exists. I skipped the frequency count as that I
don't think will add much value because we anyways plan to emit a metric which
denotes the number of instances managed by the broker
(`ClientMetricsInstanceCount`). Please review.
--
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]