From 050bd4cd2a25fe0f2e028470c7a8572742e71df0 Mon Sep 17 00:00:00 2001 From: Eric Yang Date: Mon, 26 Mar 2018 13:21:35 -0400 Subject: [PATCH] YARN-8043. Added the exception message for failed launches running under LCE. Contributed by Shane Kumpf --- .../yarn/server/nodemanager/LinuxContainerExecutor.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/LinuxContainerExecutor.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/LinuxContainerExecutor.java index 1290a6cc535..41099214a74 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/LinuxContainerExecutor.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/LinuxContainerExecutor.java @@ -565,12 +565,13 @@ public class LinuxContainerExecutor extends ContainerExecutor { builder.append("Exception from container-launch.\n"); builder.append("Container id: " + containerId + "\n"); builder.append("Exit code: " + exitCode + "\n"); + builder.append("Exception message: " + e.getMessage() + "\n"); if (!Optional.fromNullable(e.getErrorOutput()).or("").isEmpty()) { - builder.append("Exception message: " + e.getErrorOutput() + "\n"); + builder.append("Shell error output: " + e.getErrorOutput() + "\n"); } //Skip stack trace String output = e.getOutput(); - if (output != null && !e.getOutput().isEmpty()) { + if (output != null && !output.isEmpty()) { builder.append("Shell output: " + output + "\n"); } String diagnostics = builder.toString();