Pārlūkot izejas kodu

HDFS-1906. Remove logging exception stack trace in client logs when one of
the datanode targets to read from is not reachable. (suresh)


git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-0.20-security-204@1136723 13f79535-47bb-0310-9956-ffa450edef68

Owen O'Malley 14 gadi atpakaļ
vecāks
revīzija
a003fb3d34
2 mainītis faili ar 12 papildinājumiem un 4 dzēšanām
  1. 3 0
      CHANGES.txt
  2. 9 4
      src/hdfs/org/apache/hadoop/hdfs/DFSClient.java

+ 3 - 0
CHANGES.txt

@@ -39,6 +39,9 @@ Release 0.20.204.0 - unreleased
     MAPREDUCE-2514. Fix typo in TaskTracker ReinitTrackerAction log message.
     (Jonathan Eagles via cdouglas)
 
+    HDFS-1906. Remove logging exception stack trace in client logs when one of
+    the datanode targets to read from is not reachable. (suresh)
+
     MAPREDUCE-2490. Add logging to graylist and blacklist activity to aid
     diagnosis of related issues. (Jonathan Eagles via cdouglas)
 

+ 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);