adoroszlai commented on code in PR #5760:
URL: https://github.com/apache/ozone/pull/5760#discussion_r1426376323


##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/safemode/HealthyPipelineSafeModeRule.java:
##########
@@ -204,15 +206,16 @@ public String getStatusText() {
         "healthy Ratis/THREE pipelines (=%d) >= healthyPipelineThresholdCount" 
+
             " (=%d)", getCurrentHealthyPipelineCount(),
         getHealthyPipelineThresholdCount());
-    Set<PipelineID> samplePipelines = pipelineIDSet.stream()
-        .filter(element -> !processedPipelineIDs.contains(element))
-        .limit(SAMPLE_PIPELINE_DISPLAY_LIMIT)
-        .collect(Collectors.toSet());
-
-    if (!samplePipelines.isEmpty()) {
-      String samplePipelineText =
-          "Sample pipelines not satisfying the criteria : " + samplePipelines;
-      status = status.concat("/n").concat(samplePipelineText);
+    synchronized (unProcessedPipelineSet) {

Review Comment:
   `synchronized (unProcessedPipelineSet)` does not protect access, because we 
sync on other object (`this`) when changing the set.  I think the simplest fix 
is to make this method `synchronized`.



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to