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/14 12:46:22 UTC
[2/3] 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/bfadf67a
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/bfadf67a
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/bfadf67a
Branch: refs/heads/1.2.x
Commit: bfadf67a38eedbc1cdd3edfa0c6ea9b15b6d4eb3
Parents: 00d79da
Author: Qian Zhang <zh...@gmail.com>
Authored: Thu Sep 14 17:29:39 2017 +0800
Committer: Qian Zhang <zh...@gmail.com>
Committed: Tue Nov 14 16:59:19 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/bfadf67a/src/docker/executor.cpp
----------------------------------------------------------------------
diff --git a/src/docker/executor.cpp b/src/docker/executor.cpp
index d7f2134..ac826e6 100644
--- a/src/docker/executor.cpp
+++ b/src/docker/executor.cpp
@@ -463,9 +463,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
@@ -475,6 +473,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/bfadf67a/src/launcher/default_executor.cpp
----------------------------------------------------------------------
diff --git a/src/launcher/default_executor.cpp b/src/launcher/default_executor.cpp
index c03df7c..e04043a 100644
--- a/src/launcher/default_executor.cpp
+++ b/src/launcher/default_executor.cpp
@@ -650,12 +650,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/bfadf67a/src/launcher/executor.cpp
----------------------------------------------------------------------
diff --git a/src/launcher/executor.cpp b/src/launcher/executor.cpp
index 2605d82..5b278dd 100644
--- a/src/launcher/executor.cpp
+++ b/src/launcher/executor.cpp
@@ -700,12 +700,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;
}