vtutrinov commented on code in PR #7471:
URL: https://github.com/apache/ozone/pull/7471#discussion_r1856216033


##########
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/MiniOzoneHAClusterImpl.java:
##########
@@ -584,19 +586,29 @@ protected SCMHAService createSCMService()
             }
             scmList.add(scm);
 
-            if (i <= numOfActiveSCMs) {
-              scm.start();
-              activeSCMs.add(scm);
-              LOG.info("Started SCM RPC server at {}",
-                  scm.getClientRpcAddress());
-            } else {
-              inactiveSCMs.add(scm);
-              LOG.info("Intialized SCM at {}. This SCM is currently "
-                  + "inactive (not running).", scm.getClientRpcAddress());
-            }
+            int scmCounter = i;
+            new Thread(() -> {
+              if (scmCounter <= numOfActiveSCMs) {
+                try {
+                  scm.start();
+                } catch (IOException e) {
+                  scmStartCounter.countDown();
+                  throw new RuntimeException(e);
+                }
+                activeSCMs.add(scm);
+                LOG.info("Started SCM RPC server at {}",
+                    scm.getClientRpcAddress());
+              } else {
+                inactiveSCMs.add(scm);
+                LOG.info("Initialized SCM at {}. This SCM is currently "
+                    + "inactive (not running).", scm.getClientRpcAddress());
+              }
+              scmStartCounter.countDown();
+            }).start();

Review Comment:
   To imitate the simultaneous start of the number of SCMs. In integration 
tests it was impossible to catch a case when the metrics were set to 0, but 
it's possible if the SCMs start simultaneously



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