jeffkbkim commented on code in PR #14848:
URL: https://github.com/apache/kafka/pull/14848#discussion_r1424319049


##########
group-coordinator/src/main/java/org/apache/kafka/coordinator/group/metrics/GroupCoordinatorMetrics.java:
##########
@@ -77,29 +70,13 @@ public class GroupCoordinatorMetrics extends 
CoordinatorMetrics implements AutoC
 
     private final MetricsRegistry registry;
     private final Metrics metrics;
-    private final Map<TopicPartition, CoordinatorMetricsShard> shards = new 
HashMap<>();
-    private static final AtomicLong 
NUM_GENERIC_GROUPS_PREPARING_REBALANCE_COUNTER = new AtomicLong(0);
-    private static final AtomicLong 
NUM_GENERIC_GROUPS_COMPLETING_REBALANCE_COUNTER = new AtomicLong(0);
-    private static final AtomicLong NUM_GENERIC_GROUPS_STABLE_COUNTER = new 
AtomicLong(0);
-    private static final AtomicLong NUM_GENERIC_GROUPS_DEAD_COUNTER = new 
AtomicLong(0);
-    private static final AtomicLong NUM_GENERIC_GROUPS_EMPTY_COUNTER = new 
AtomicLong(0);
+    private final Map<TopicPartition, GroupCoordinatorMetricsShard> shards = 
new ConcurrentHashMap<>();

Review Comment:
   we may have concurrent modification when the metric thread scrapes a shard 
while the shard is removed from `shards` on deactivate.



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