YARN-5299. Log Docker run command when container fails. Contributed by Varun Vasudev.
(cherry picked from commit dbe97aa768
)
This commit is contained in:
parent
dba8eee899
commit
356c09a509
|
@ -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());
|
||||||
|
|
Loading…
Reference in New Issue