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



##########
File path: 
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/ha/SCMStateMachine.java
##########
@@ -394,6 +394,9 @@ public void close() throws IOException {
     transactionBuffer.close();
     HadoopExecutors.
         shutdown(installSnapshotExecutor, LOG, 5, TimeUnit.SECONDS);
+    scm.stop();
+    ExitUtils.terminate(1, "ScmStateMachine is closed, shutdown SCM",
+        StateMachine.LOG);

Review comment:
       `OzoneManager` has a `shutdown` method that performs these two steps.  I 
think it would be nice to make OM and SCM consistent by moving these to a new 
`shutdown` method in `StorageContainerManager`.

##########
File path: 
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/ratis/OzoneManagerStateMachine.java
##########
@@ -470,6 +470,8 @@ public void close() throws IOException {
     // OM should be shutdown as the StateMachine has shutdown.
     LOG.info("StateMachine has shutdown. Shutdown OzoneManager if not " +
         "already shutdown.");
+    super.close();
+    ozoneManager.close();

Review comment:
       `OzoneManager.close` only calls `stop`, which `shutdown` already does, 
so this unnecessary.  I think it also prevents system exit, since `shutdown` 
does nothing if OM is already stopped.
   
   ```suggestion
   ```




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