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 committed by Billie Rinaldi
parent 099e9fb226
commit 050bd4cd2a
1 changed files with 3 additions and 2 deletions

View File

@ -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();