kevin-wu24 commented on code in PR #19828:
URL: https://github.com/apache/kafka/pull/19828#discussion_r2109394645


##########
metadata/src/main/java/org/apache/kafka/controller/metrics/QuorumControllerMetrics.java:
##########
@@ -267,7 +267,11 @@ public long newActiveControllers() {
     }
 
     public void updateBrokerContactTime(int brokerId) {
-        brokerContactTimesMs.putIfAbsent(brokerId, new 
AtomicLong(time.milliseconds()));
+        if (!brokerContactTimesMs.containsKey(brokerId)) {
+            brokerContactTimesMs.put(brokerId, new 
AtomicLong(time.milliseconds()));
+        } else {
+            brokerContactTimesMs.get(brokerId).set(time.milliseconds());
+        }

Review Comment:
   Thanks, just changed.



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

Reply via email to