ソースを参照

HDFS-7763. fix zkfc hung issue due to not catching exception in a corner case. Contributed by Liang Xie.

(cherry picked from commit 7105ebaa9f370db04962a1e19a67073dc080433b)
(cherry picked from commit efb7e287f45c6502f293456034a37d9209a917be)
(cherry picked from commit fd70e4db105e140fc3d60042abb3f598c9afd13f)
Andrew Wang 10 年 前
コミット
406ec495bb

+ 3 - 0
hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt

@@ -79,6 +79,9 @@ Release 2.6.1 - UNRELEASED
     HDFS-7009. Active NN and standby NN have different live nodes.
     (Ming Ma via cnauroth)
 
+    HDFS-7763. fix zkfc hung issue due to not catching exception in a corner
+    case. (Liang Xie via wang)
+
 Release 2.6.0 - 2014-11-18
 
   INCOMPATIBLE CHANGES

+ 7 - 2
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/tools/DFSZKFailoverController.java

@@ -176,8 +176,13 @@ public class DFSZKFailoverController extends ZKFailoverController {
         new HdfsConfiguration(), args);
     DFSZKFailoverController zkfc = DFSZKFailoverController.create(
         parser.getConfiguration());
-    
-    System.exit(zkfc.run(parser.getRemainingArgs()));
+    int retCode = 0;
+    try {
+      retCode = zkfc.run(parser.getRemainingArgs());
+    } catch (Throwable t) {
+      LOG.fatal("Got a fatal error, exiting now", t);
+    }
+    System.exit(retCode);
   }
 
   @Override