Просмотр исходного кода

HADOOP-19337. Fix ZKFailoverController NPE issue due to integer overflow in parseInt when initHM. (#7165). Contributed by ConfX.

Co-authored-by: saadsheralam <saadsheralamfkah@gmail.com>
Signed-off-by: He Xiaoqiao <hexiaoqiao@apache.org>
ConfX 5 месяцев назад
Родитель
Сommit
de8b5061d8

+ 5 - 2
hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ha/ZKFailoverController.java

@@ -263,8 +263,11 @@ public abstract class ZKFailoverController {
       rpcServer.stopAndJoin();
       
       elector.quitElection(true);
-      healthMonitor.shutdown();
-      healthMonitor.join();
+
+      if (healthMonitor != null) {
+        healthMonitor.shutdown();
+        healthMonitor.join();
+      }
     }
     return 0;
   }