adoroszlai commented on a change in pull request #2953:
URL: https://github.com/apache/ozone/pull/2953#discussion_r809899365



##########
File path: 
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/ha/SCMStateMachine.java
##########
@@ -387,10 +387,20 @@ public void reinitialize() throws IOException {
 
   @Override
   public void close() throws IOException {
+    super.close();
+    stop();
+    try {
+      ExitUtils.terminate(1, "scm state machine terminated by ratis", LOG);
+    } catch (ExitUtils.ExitException e) {
+      LOG.info("scm state machine is terminated by Ratis, " +
+          "but termination is disabled: {}", e.getMessage());
+    }
+  }
+
+  public void stop() throws IOException {
     if (!isInitialized) {
       return;
     }

Review comment:
       Sorry if I was unclear.  What I meant is this:
   
   
https://github.com/apache/ozone/blob/2d53a7f48da7a2efb64a8675f93f38ae445a180f/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/ha/SCMStateMachine.java#L388-L403
   
   The patch moves this check for `isInitialized` to the new `stop` method.
   
   My suggestion is to keep it in `close` (or both).  This way we can prevent 
system exit when SCM is not initialized.  So the `disableSystemExit` call in 
`scmInit` becomes unnecessary.




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