From 738c2a9682880061c12286cb88882c125a8dfd57 Mon Sep 17 00:00:00 2001 From: Chen Liang Date: Mon, 11 Sep 2017 14:48:07 -0700 Subject: [PATCH] HDFS-12406. dfsadmin command prints "Exception encountered" even if there is no exception, when debug is enabled. Contributed by Nandakumar. --- .../src/main/java/org/apache/hadoop/hdfs/tools/DFSAdmin.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/tools/DFSAdmin.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/tools/DFSAdmin.java index cc7eb1b06d5..9805972bdfe 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/tools/DFSAdmin.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/tools/DFSAdmin.java @@ -2244,7 +2244,7 @@ public class DFSAdmin extends FsShell { System.err.println(cmd.substring(1) + ": " + e.getLocalizedMessage()); } - if (LOG.isDebugEnabled()) { + if (LOG.isDebugEnabled() && debugException != null) { LOG.debug("Exception encountered:", debugException); } return exitCode;