瀏覽代碼

HDFS-1906. Remove logging exception stack trace in client logs (Porting change from trunk)

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-0.20-security@1125170 13f79535-47bb-0310-9956-ffa450edef68
Suresh Srinivas 14 年之前
父節點
當前提交
ffea5e5541
共有 2 個文件被更改,包括 13 次插入4 次删除
  1. 4 0
      CHANGES.txt
  2. 9 4
      src/hdfs/org/apache/hadoop/hdfs/DFSClient.java

+ 4 - 0
CHANGES.txt

@@ -26,6 +26,10 @@ Release 0.20.205.0 - unreleased
 
     HADOOP-7272. Remove unnecessary security related info logs. (suresh)
 
+    HDFS-1906. Remove logging exception stack trace in client logs when one of
+    the datanode targets to read from is not reachable. (suresh)
+
+
 Release 0.20.204.0 - unreleased
 
   BUG FIXES

+ 9 - 4
src/hdfs/org/apache/hadoop/hdfs/DFSClient.java

@@ -1783,8 +1783,11 @@ public class DFSClient implements FSConstants, java.io.Closeable {
             refetchToken--;
             fetchBlockAt(target);
           } else {
-            LOG.info("Failed to connect to " + targetAddr
-                + ", add to deadNodes and continue", ex);
+            LOG.warn("Failed to connect to " + targetAddr
+                + ", add to deadNodes and continue" + ex);
+            if (LOG.isDebugEnabled()) {
+              LOG.debug("Connection failure", ex);
+            }
             // Put chosen node into dead list, continue
             addToDeadNodes(chosenNode);
           }
@@ -2016,8 +2019,10 @@ public class DFSClient implements FSConstants, java.io.Closeable {
             continue;
           } else {
             LOG.warn("Failed to connect to " + targetAddr + " for file " + src
-                + " for block " + block.getBlock() + ":"
-                + StringUtils.stringifyException(e));
+                + " for block " + block.getBlock() + ":" + e);
+            if (LOG.isDebugEnabled()) {
+              LOG.debug("Connection failure ", e);
+            }
           }
         } finally {
           IOUtils.closeStream(reader);