From 64e739e344ac474046d4f4ecf0865dd92be13762 Mon Sep 17 00:00:00 2001 From: Anu Engineer Date: Fri, 27 Jul 2018 06:11:56 -0700 Subject: [PATCH] HDFS-13727. Log full stack trace if DiskBalancer exits with an unhandled exception. Contributed by Gabor Bota. --- .../java/org/apache/hadoop/hdfs/tools/DiskBalancerCLI.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/tools/DiskBalancerCLI.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/tools/DiskBalancerCLI.java index 00e6f0499a9..34bd68bc684 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/tools/DiskBalancerCLI.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/tools/DiskBalancerCLI.java @@ -172,7 +172,9 @@ public class DiskBalancerCLI extends Configured implements Tool { try { res = ToolRunner.run(shell, argv); } catch (Exception ex) { - LOG.error(ex.toString()); + String msg = String.format("Exception thrown while running %s.", + DiskBalancerCLI.class.getSimpleName()); + LOG.error(msg, ex); res = 1; } System.exit(res);