瀏覽代碼

HADOOP-9593 stack trace printed at ERROR for all yarn clients without hadoop.home set

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1485842 13f79535-47bb-0310-9956-ffa450edef68
Steve Loughran 12 年之前
父節點
當前提交
10d21ac779

+ 4 - 1
hadoop-common-project/hadoop-common/CHANGES.txt

@@ -370,7 +370,10 @@ Trunk (Unreleased)
     HADOOP-9481. Broken conditional logic with HADOOP_SNAPPY_LIBRARY. (Vadim
     Bondarev via atm)
 
-  OPTIMIZATIONS
+    HADOOP-9593. stack trace printed at ERROR for all yarn clients without
+    hadoop.home set (stevel)
+
+    OPTIMIZATIONS
 
     HADOOP-7761. Improve the performance of raw comparisons. (todd)
 

+ 9 - 4
hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/Shell.java

@@ -227,8 +227,10 @@ abstract public class Shell {
        home = homedir.getCanonicalPath();
 
     } catch (IOException ioe) {
-       LOG.error("Failed to detect a valid hadoop home directory", ioe);
-       home = null;
+      if (LOG.isDebugEnabled()) {
+        LOG.debug("Failed to detect a valid hadoop home directory", ioe);
+      }
+      home = null;
     }
     
     return home;
@@ -305,10 +307,13 @@ abstract public class Shell {
       shexec = new ShellCommandExecutor(args);
       shexec.execute();
     } catch (IOException ioe) {
-      LOG.warn("setsid is not available on this machine. So not using it.");
+      LOG.debug("setsid is not available on this machine. So not using it.");
       setsidSupported = false;
     } finally { // handle the exit code
-      LOG.info("setsid exited with exit code " + shexec.getExitCode());
+      if (LOG.isDebugEnabled()) {
+        LOG.debug("setsid exited with exit code "
+                 + (shexec != null ? shexec.getExitCode() : "(null executor)"));
+      }
     }
     return setsidSupported;
   }