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

(cherry picked from commit dbe97aa768)
This commit is contained in:
Rohith Sharma K S 2016-07-14 11:48:10 +05:30
parent dba8eee899
commit 356c09a509
1 changed files with 5 additions and 0 deletions

View File

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