YARN-5299. Log Docker run command when container fails. Contributed by Varun Vasudev.

This commit is contained in:
Rohith Sharma K S 2016-07-14 11:48:10 +05:30
parent 2bbc3ea1b5
commit dbe97aa768

View File

@ -416,6 +416,10 @@ public void launchContainer(ContainerRuntimeContext ctx)
if (tcCommandFile != null) {
launchOp.appendArgs(tcCommandFile);
}
if (LOG.isDebugEnabled()) {
LOG.debug("Launching container with cmd: " + runCommand
.getCommandWithArguments());
}
try {
privilegedOperationExecutor.executePrivilegedOperation(null,
@ -423,6 +427,7 @@ public void launchContainer(ContainerRuntimeContext ctx)
false, false);
} catch (PrivilegedOperationException e) {
LOG.warn("Launch container failed. Exception: ", e);
LOG.info("Docker command used: " + runCommand.getCommandWithArguments());
throw new ContainerExecutionException("Launch container failed", e
.getExitCode(), e.getOutput(), e.getErrorOutput());