From 7105ebaa9f370db04962a1e19a67073dc080433b Mon Sep 17 00:00:00 2001 From: Andrew Wang Date: Tue, 24 Feb 2015 15:31:13 -0800 Subject: [PATCH] HDFS-7763. fix zkfc hung issue due to not catching exception in a corner case. Contributed by Liang Xie. --- hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt | 3 +++ .../hadoop/hdfs/tools/DFSZKFailoverController.java | 9 +++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt index 618ad70a415..4ca10da67c6 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt +++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt @@ -1020,6 +1020,9 @@ Release 2.7.0 - UNRELEASED HDFS-7831. Fix the starting index and end condition of the loop in FileDiffList.findEarlierSnapshotBlocks(). (Konstantin Shvachko via jing9) + HDFS-7763. fix zkfc hung issue due to not catching exception in a corner + case. (Liang Xie via wang) + BREAKDOWN OF HDFS-7584 SUBTASKS AND RELATED JIRAS HDFS-7720. Quota by Storage Type API, tools and ClientNameNode diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/tools/DFSZKFailoverController.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/tools/DFSZKFailoverController.java index a42b1e31895..85f77f1b7d1 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/tools/DFSZKFailoverController.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/tools/DFSZKFailoverController.java @@ -176,8 +176,13 @@ public static void main(String args[]) 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