You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by qi...@apache.org on 2017/11/01 11:54:51 UTC

[4/5] mesos git commit: Always send TASK_KILLED when the task is killed by a framework.

Always send TASK_KILLED when the task is killed by a framework.

This change is done for command, docker and default executors.

Review: https://reviews.apache.org/r/62326


Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/0449a084
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/0449a084
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/0449a084

Branch: refs/heads/master
Commit: 0449a0840d154fc169fb0b1d866d8c6b87ca5eae
Parents: ce83476
Author: Qian Zhang <zh...@gmail.com>
Authored: Thu Sep 14 17:29:39 2017 +0800
Committer: Qian Zhang <zh...@gmail.com>
Committed: Wed Nov 1 15:34:10 2017 +0800

----------------------------------------------------------------------
 src/docker/executor.cpp           | 6 +++---
 src/launcher/default_executor.cpp | 6 +++---
 src/launcher/executor.cpp         | 6 +++---
 3 files changed, 9 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/0449a084/src/docker/executor.cpp
----------------------------------------------------------------------
diff --git a/src/docker/executor.cpp b/src/docker/executor.cpp
index 5f6a0d0..3974f20 100644
--- a/src/docker/executor.cpp
+++ b/src/docker/executor.cpp
@@ -524,9 +524,7 @@ private:
       CHECK(WIFEXITED(status) || WIFSIGNALED(status))
         << "Unexpected wait status " << status;
 
-      if (WSUCCEEDED(status)) {
-        state = TASK_FINISHED;
-      } else if (killed) {
+      if (killed) {
         // Send TASK_KILLED if the task was killed as a result of
         // kill() or shutdown(). Note that in general there is a
         // race between signaling the container and it terminating
@@ -536,6 +534,8 @@ private:
         // determine whether the container was terminated via
         // our signal or terminated on its own.
         state = TASK_KILLED;
+      } else if (WSUCCEEDED(status)) {
+        state = TASK_FINISHED;
       } else {
         state = TASK_FAILED;
       }

http://git-wip-us.apache.org/repos/asf/mesos/blob/0449a084/src/launcher/default_executor.cpp
----------------------------------------------------------------------
diff --git a/src/launcher/default_executor.cpp b/src/launcher/default_executor.cpp
index 3064052..248c46d 100644
--- a/src/launcher/default_executor.cpp
+++ b/src/launcher/default_executor.cpp
@@ -827,12 +827,12 @@ protected:
       CHECK(WIFEXITED(status) || WIFSIGNALED(status))
         << "Unexpected wait status " << status;
 
-      if (WSUCCEEDED(status)) {
-        taskState = TASK_FINISHED;
-      } else if (container->killing) {
+      if (container->killing) {
         // Send TASK_KILLED if the task was killed as a result of
         // `killTask()` or `shutdown()`.
         taskState = TASK_KILLED;
+      } else if (WSUCCEEDED(status)) {
+        taskState = TASK_FINISHED;
       } else {
         taskState = TASK_FAILED;
       }

http://git-wip-us.apache.org/repos/asf/mesos/blob/0449a084/src/launcher/executor.cpp
----------------------------------------------------------------------
diff --git a/src/launcher/executor.cpp b/src/launcher/executor.cpp
index 34f6f7a..c688c04 100644
--- a/src/launcher/executor.cpp
+++ b/src/launcher/executor.cpp
@@ -913,12 +913,12 @@ private:
       CHECK(WIFEXITED(status) || WIFSIGNALED(status))
         << "Unexpected wait status " << status;
 
-      if (WSUCCEEDED(status)) {
-        taskState = TASK_FINISHED;
-      } else if (killed) {
+      if (killed) {
         // Send TASK_KILLED if the task was killed as a result of
         // kill() or shutdown().
         taskState = TASK_KILLED;
+      } else if (WSUCCEEDED(status)) {
+        taskState = TASK_FINISHED;
       } else {
         taskState = TASK_FAILED;
       }