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


##########
hadoop-ozone/mini-cluster/src/main/java/org/apache/hadoop/ozone/MiniOzoneClusterProvider.java:
##########
@@ -215,14 +221,27 @@ private Thread createClusters() {
           cluster = builder.build();
           cluster.waitForClusterToBeReady();
           createdCount++;
-          clusters.put(cluster);
+          if (!addClusterResult(ClusterCreationResult.success(cluster))) {
+            cluster.shutdown();
+            break;
+          }
         } catch (InterruptedException e) {
           if (cluster != null) {
             cluster.shutdown();
           }
           break;
         } catch (IOException | TimeoutException e) {

Review Comment:
   Thank you for pointing this out. I added **RuntimeException** to the 
existing multi-catch and updated **TestBuilder** to rethrow runtime exceptions 
as suggested.
   
   I added **retriesAfterRuntimeBuildFailure()** to verify that **provide()** 
preserves the original exception as its cause and that a subsequent call 
receives a successfully created cluster. I also added a readiness failure test 
to verify cleanup when **build()** returns a cluster but 
**waitForClusterToBeReady()** throws a runtime exception. Both tests verify 
that failures do not consume the cluster limit.



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