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


##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/pipeline/WritableECContainerProvider.java:
##########
@@ -143,14 +145,20 @@ public ContainerInfo getContainer(final long size,
               + "container", e);
           existingPipelines.remove(pipelineIndex);
           pipelineManager.closePipeline(pipeline, true);
+          openPipelineCount--;
         }
       }
     }
     // If we get here, all the pipelines we tried were no good. So try to
     // allocate a new one.
     try {
       synchronized (this) {
-        return allocateContainer(repConfig, size, owner, excludeList);
+        if (openPipelineCount < minimumPipelines) {
+          return allocateContainer(repConfig, size, owner, excludeList);
+        }
+        throw new IOException("Unable to allocate a pipeline for "
+            + repConfig + " after trying all existing pipelines as the max "
+            + "limit has been reached and no pipelines where closed");

Review Comment:
   Nit: I wonder if we should rename `minimumPipelines` (and 
`getMinimumPipelines`) to `maximum`.



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