echonesis commented on code in PR #10989:
URL: https://github.com/apache/ozone/pull/10989#discussion_r3792331295


##########
hadoop-ozone/mini-cluster/src/main/java/org/apache/hadoop/ozone/MiniOzoneClusterProvider.java:
##########
@@ -215,14 +219,22 @@ private Thread createClusters() {
           cluster = builder.build();
           cluster.waitForClusterToBeReady();
           createdCount++;
-          clusters.put(cluster);
+          clusterResults.put(ClusterCreationResult.success(cluster));
         } catch (InterruptedException e) {
           if (cluster != null) {
             cluster.shutdown();
           }
           break;
         } catch (IOException | TimeoutException e) {
-          throw new RuntimeException("Unable to build cluster", e);
+          LOG.warn("Unable to build cluster", e);
+          if (cluster != null) {
+            cluster.shutdown();
+          }
+          try {
+            clusterResults.put(ClusterCreationResult.failure(e));

Review Comment:
   Good point. I’ll use a 1-second timed offer() loop guarded by a shutdown 
flag. This avoids blocking join() indefinitely while preserving normal queue 
backpressure; any cluster that cannot be enqueued during shutdown will be 
closed.



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