1
0
Kaynağa Gözat

YARN-4252. Log container-executor invocation details when exit code is non-zero. Contributed by Sidharta Seethana.

Varun Vasudev 9 yıl önce
ebeveyn
işleme
fb9c1519b3

+ 3 - 0
hadoop-yarn-project/CHANGES.txt

@@ -501,6 +501,9 @@ Release 2.8.0 - UNRELEASED
     YARN-3943. Use separate threshold configurations for disk-full detection
     YARN-3943. Use separate threshold configurations for disk-full detection
     and disk-not-full detection. (Zhihai Xu via jlowe)
     and disk-not-full detection. (Zhihai Xu via jlowe)
 
 
+    YARN-4252. Log container-executor invocation details when exit code is non-zero.
+    (Sidharta Seethana via vvasudev)
+
   OPTIMIZATIONS
   OPTIMIZATIONS
 
 
     YARN-3339. TestDockerContainerExecutor should pull a single image and not
     YARN-3339. TestDockerContainerExecutor should pull a single image and not

+ 8 - 3
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/linux/privileged/PrivilegedOperationExecutor.java

@@ -155,12 +155,17 @@ public class PrivilegedOperationExecutor {
         LOG.debug(exec.getOutput());
         LOG.debug(exec.getOutput());
       }
       }
     } catch (ExitCodeException e) {
     } catch (ExitCodeException e) {
-      String logLine = new StringBuffer("Shell execution returned exit code: ")
+      StringBuilder logBuilder = new StringBuilder("Shell execution returned "
+          + "exit code: ")
           .append(exec.getExitCode())
           .append(exec.getExitCode())
           .append(". Privileged Execution Operation Output: ")
           .append(". Privileged Execution Operation Output: ")
-          .append(System.lineSeparator()).append(exec.getOutput()).toString();
+          .append(System.lineSeparator()).append(exec.getOutput());
 
 
-      LOG.warn(logLine);
+      logBuilder.append("Full command array for failed execution: ")
+          .append(System.lineSeparator());
+      logBuilder.append(Arrays.toString(fullCommandArray));
+
+      LOG.warn(logBuilder.toString());
 
 
       //stderr from shell executor seems to be stuffed into the exception
       //stderr from shell executor seems to be stuffed into the exception
       //'message' - so, we have to extract it and set it as the error out
       //'message' - so, we have to extract it and set it as the error out