arp7 commented on a change in pull request #1533:
URL: https://github.com/apache/ozone/pull/1533#discussion_r519993420



##########
File path: 
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/statemachine/DatanodeStateMachine.java
##########
@@ -399,18 +390,27 @@ public boolean isTransitionAllowedTo(DatanodeStates 
newState) {
    * Start datanode state machine as a single thread daemon.
    */
   public void startDaemon() {
-    Runnable startStateMachineTask = () -> {
-      try {
-        start();
-        LOG.info("Ozone container server started.");
-      } catch (Exception ex) {
-        LOG.error("Unable to start the DatanodeState Machine", ex);
-      }
-    };
+    reportManager.init();
+    initCommandHandlerThread(conf);
+
+    // Start jvm monitor
+    jvmPauseMonitor = new JvmPauseMonitor();
+    jvmPauseMonitor
+        .init(LegacyHadoopConfigurationSource.asHadoopConfiguration(conf));
+    jvmPauseMonitor.start();
+
     stateMachineThread =  new ThreadFactoryBuilder()
         .setDaemon(true)
         .setNameFormat("Datanode State Machine Thread - %d")
-        .build().newThread(startStateMachineTask);
+        .setUncaughtExceptionHandler((Thread t, Throwable e) -> {

Review comment:
       Would it be better for the DN to just self-terminate if there is an 
uncaught exception in the state machine thread? Do we know what was the exact 
uncaught exception?




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

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