hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ey...@apache.org
Subject hadoop git commit: YARN-8465. Fixed docker container status for node manager restart. Contributed by Shane Kumpf
Date Mon, 02 Jul 2018 17:39:31 GMT
Repository: hadoop
Updated Branches:
  refs/heads/trunk fef20a446 -> 5cc2541a1


YARN-8465. Fixed docker container status for node manager restart.
           Contributed by Shane Kumpf


Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/5cc2541a
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/5cc2541a
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/5cc2541a

Branch: refs/heads/trunk
Commit: 5cc2541a163591181b80bf2ec42c1e7e7f8929f5
Parents: fef20a4
Author: Eric Yang <eyang@apache.org>
Authored: Mon Jul 2 13:37:51 2018 -0400
Committer: Eric Yang <eyang@apache.org>
Committed: Mon Jul 2 13:37:51 2018 -0400

----------------------------------------------------------------------
 .../linux/runtime/DockerLinuxContainerRuntime.java        |  4 ++--
 .../runtime/ContainerExecutionException.java              |  6 ++++++
 .../linux/runtime/TestDockerContainerRuntime.java         | 10 ++++++++--
 3 files changed, 16 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/5cc2541a/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
----------------------------------------------------------------------
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 f13ba59..c89d5fb 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
@@ -1027,7 +1027,6 @@ public class DockerLinuxContainerRuntime implements LinuxContainerRuntime
{
         handleContainerKill(ctx, env, signal);
       }
     } catch (ContainerExecutionException e) {
-      LOG.warn("Signal docker container failed. Exception: ", e);
       throw new ContainerExecutionException("Signal docker container failed",
           e.getExitCode(), e.getOutput(), e.getErrorOutput());
     }
@@ -1201,7 +1200,8 @@ public class DockerLinuxContainerRuntime implements LinuxContainerRuntime
{
     if (!new File(procFs + File.separator + pid).exists()) {
       String msg = "Liveliness check failed for PID: " + pid
           + ". Container may have already completed.";
-      throw new ContainerExecutionException(msg);
+      throw new ContainerExecutionException(msg,
+          PrivilegedOperation.ResultCode.INVALID_CONTAINER_PID.getValue());
     }
   }
 

http://git-wip-us.apache.org/repos/asf/hadoop/blob/5cc2541a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/runtime/ContainerExecutionException.java
----------------------------------------------------------------------
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/runtime/ContainerExecutionException.java
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/runtime/ContainerExecutionException.java
index 3147277..735db1f 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/runtime/ContainerExecutionException.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/runtime/ContainerExecutionException.java
@@ -53,6 +53,12 @@ public class ContainerExecutionException extends YarnException {
     errorOutput = OUTPUT_UNSET;
   }
 
+  public ContainerExecutionException(String message, int exitCode) {
+    super(message);
+    this.exitCode = exitCode;
+    this.output = OUTPUT_UNSET;
+    this.errorOutput = OUTPUT_UNSET;
+  }
 
   public ContainerExecutionException(String message, int exitCode, String
       output, String errorOutput) {

http://git-wip-us.apache.org/repos/asf/hadoop/blob/5cc2541a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/linux/runtime/TestDockerContainerRuntime.java
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/linux/runtime/TestDockerContainerRuntime.java
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/linux/runtime/TestDockerContainerRuntime.java
index d85c403..855ec44 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/linux/runtime/TestDockerContainerRuntime.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/linux/runtime/TestDockerContainerRuntime.java
@@ -1492,7 +1492,7 @@ public class TestDockerContainerRuntime {
     runtime.signalContainer(builder.build());
   }
 
-  @Test(expected = ContainerExecutionException.class)
+  @Test
   public void testContainerLivelinessNoFileException() throws Exception {
     DockerLinuxContainerRuntime runtime = new DockerLinuxContainerRuntime(
         mockExecutor, mockCGroupsHandler);
@@ -1501,7 +1501,13 @@ public class TestDockerContainerRuntime {
         .setExecutionAttribute(PID, signalPid)
         .setExecutionAttribute(SIGNAL, ContainerExecutor.Signal.NULL);
     runtime.initialize(enableMockContainerExecutor(conf), null);
-    runtime.signalContainer(builder.build());
+    try {
+      runtime.signalContainer(builder.build());
+    } catch (ContainerExecutionException e) {
+      Assert.assertEquals(
+          PrivilegedOperation.ResultCode.INVALID_CONTAINER_PID.getValue(),
+          e.getExitCode());
+    }
   }
 
   @Test


---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org


Mime
View raw message