YARN-8043. Added the exception message for failed launches running under LCE.

Contributed by Shane Kumpf
This commit is contained in:
Eric Yang 2018-03-26 13:21:35 -04:00
parent 947b282984
commit e6b74164e9
1 changed files with 3 additions and 2 deletions

View File

@ -563,12 +563,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();