From dbe97aa768e2987209811c407969fea47641418c Mon Sep 17 00:00:00 2001 From: Rohith Sharma K S Date: Thu, 14 Jul 2016 11:48:10 +0530 Subject: [PATCH] YARN-5299. Log Docker run command when container fails. Contributed by Varun Vasudev. --- .../linux/runtime/DockerLinuxContainerRuntime.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/linux/runtime/DockerLinuxContainerRuntime.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/linux/runtime/DockerLinuxContainerRuntime.java index 4398e54a78..e1a162e9cd 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/linux/runtime/DockerLinuxContainerRuntime.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/linux/runtime/DockerLinuxContainerRuntime.java @@ -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());