keith-turner commented on code in PR #4150:
URL: https://github.com/apache/accumulo/pull/4150#discussion_r1448056284


##########
server/manager/src/main/java/org/apache/accumulo/manager/compaction/coordinator/QueueMetrics.java:
##########
@@ -139,7 +140,16 @@ public void update() {
 
     SetView<CompactorGroupId> metricsWithoutQueues =
         Sets.difference(queuesWithMetrics, definedQueues);
-    metricsWithoutQueues.forEach(q -> {
+    Set<CompactorGroupId> toRemove = new 
HashSet<>(metricsWithoutQueues.size());

Review Comment:
   There is another loop above this that is modifying perQeueMetrics while 
iterating over a set view that is based on it.  Maybe doing the following at 
the beginning of the method would avoid the problem for both loops.
   
   ```java
   Set<CompactorGroupId> queuesWithMetrics = 
Set.copyOf(perQueueMetrics.keySet());
   ```



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