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:40:21 GMT
Repository: hadoop
Updated Branches:
  refs/heads/branch-3.1 2ce892fcf -> 0aa727219


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/0aa72721
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/0aa72721
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/0aa72721

Branch: refs/heads/branch-3.1
Commit: 0aa72721997da4bbdcd3cbebb7a274da2e6e558e
Parents: 2ce892f
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:40:02 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/0aa72721/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 d9dd22f..5d95875 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
@@ -1031,7 +1031,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());
     }
@@ -1205,7 +1204,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/0aa72721/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/0aa72721/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 67d4952..1d5c58d 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
@@ -1487,7 +1487,7 @@ public class TestDockerContainerRuntime {
     runtime.signalContainer(builder.build());
   }
 
-  @Test(expected = ContainerExecutionException.class)
+  @Test
   public void testContainerLivelinessNoFileException() throws Exception {
     DockerLinuxContainerRuntime runtime = new DockerLinuxContainerRuntime(
         mockExecutor, mockCGroupsHandler);
@@ -1496,7 +1496,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