Browse Source

HDDS-1331. In DatanodeStateMachine join check for not null.

Bharat Viswanadham 6 years ago
parent
commit
128dd91e10

+ 7 - 2
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/statemachine/DatanodeStateMachine.java

@@ -363,8 +363,13 @@ public class DatanodeStateMachine implements Closeable {
    * @throws InterruptedException
    */
   public void join() throws InterruptedException {
-    stateMachineThread.join();
-    cmdProcessThread.join();
+    if (stateMachineThread != null) {
+      stateMachineThread.join();
+    }
+
+    if (cmdProcessThread != null) {
+      cmdProcessThread.join();
+    }
   }
 
   /**