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

[1/2] mesos git commit: Fixed default executor handling of nested container status.

Repository: mesos
Updated Branches:
  refs/heads/1.3.x c94489e15 -> b6f6e7a13


Fixed default executor handling of nested container status.

The default executor was not handling a missing nested container
exit status correctly. It was assuming the protobuf accessor was
returning an Option rather than explicitly checking whether the
`exit_status` field was present in the message.

Added the explicit check for the `exit_status` field, and always
propagated an appropriate message into the status update, even
when the `exit_status` is absent. Added some documentation of
the `exit_status` field to the protobuf definition files.

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


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

Branch: refs/heads/1.3.x
Commit: 079051d66e8fbbdbabffe27d4cbd9cbde73879f3
Parents: c94489e
Author: James Peach <jp...@apache.org>
Authored: Thu Oct 12 09:17:16 2017 -0700
Committer: James Peach <jp...@apache.org>
Committed: Fri Nov 3 10:53:41 2017 -0700

----------------------------------------------------------------------
 include/mesos/agent/agent.proto    |  4 ++++
 include/mesos/v1/agent/agent.proto |  4 ++++
 src/launcher/default_executor.cpp  | 20 ++++++++++----------
 support/push-commits.py            |  8 +++++++-
 4 files changed, 25 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/079051d6/include/mesos/agent/agent.proto
----------------------------------------------------------------------
diff --git a/include/mesos/agent/agent.proto b/include/mesos/agent/agent.proto
index 9bac954..505edfd 100644
--- a/include/mesos/agent/agent.proto
+++ b/include/mesos/agent/agent.proto
@@ -330,6 +330,10 @@ message Response {
 
   // Returns termination information about the nested container.
   message WaitNestedContainer {
+    // Wait status of the lead process in the container. Note that this
+    // is the return value of `wait(2)`, so callers must use the `wait(2)`
+    // family of macros to extract whether the process exited cleanly and
+    // what the exit code was.
     optional int32 exit_status = 1;
   }
 

http://git-wip-us.apache.org/repos/asf/mesos/blob/079051d6/include/mesos/v1/agent/agent.proto
----------------------------------------------------------------------
diff --git a/include/mesos/v1/agent/agent.proto b/include/mesos/v1/agent/agent.proto
index ea9282c..6e4fef6 100644
--- a/include/mesos/v1/agent/agent.proto
+++ b/include/mesos/v1/agent/agent.proto
@@ -330,6 +330,10 @@ message Response {
 
   // Returns termination information about the nested container.
   message WaitNestedContainer {
+    // Wait status of the lead process in the container. Note that this
+    // is the return value of `wait(2)`, so callers must use the `wait(2)`
+    // family of macros to extract whether the process exited cleanly and
+    // what the exit code was.
     optional int32 exit_status = 1;
   }
 

http://git-wip-us.apache.org/repos/asf/mesos/blob/079051d6/src/launcher/default_executor.cpp
----------------------------------------------------------------------
diff --git a/src/launcher/default_executor.cpp b/src/launcher/default_executor.cpp
index 5c31f94..da496e3 100644
--- a/src/launcher/default_executor.cpp
+++ b/src/launcher/default_executor.cpp
@@ -764,15 +764,16 @@ protected:
     TaskState taskState;
     Option<string> message;
 
-    Option<int> status = waitResponse->wait_nested_container().exit_status();
-
-    if (status.isNone()) {
+    if (!waitResponse->wait_nested_container().has_exit_status()) {
       taskState = TASK_FAILED;
+      message = "Command terminated with unknown status";
     } else {
-      CHECK(WIFEXITED(status.get()) || WIFSIGNALED(status.get()))
-        << "Unexpected wait status " << status.get();
+      int status = waitResponse->wait_nested_container().exit_status();
+
+      CHECK(WIFEXITED(status) || WIFSIGNALED(status))
+        << "Unexpected wait status " << status;
 
-      if (WSUCCEEDED(status.get())) {
+      if (WSUCCEEDED(status)) {
         taskState = TASK_FINISHED;
       } else if (container->killing) {
         // Send TASK_KILLED if the task was killed as a result of
@@ -782,7 +783,7 @@ protected:
         taskState = TASK_FAILED;
       }
 
-      message = "Command " + WSTRINGIFY(status.get());
+      message = "Command " + WSTRINGIFY(status);
     }
 
     TaskStatus taskStatus = createTaskStatus(
@@ -803,9 +804,8 @@ protected:
 
     LOG(INFO)
       << "Child container " << container->containerId << " of task '" << taskId
-      << "' in state " << stringify(taskState) << " "
-      << (status.isSome() ? WSTRINGIFY(status.get())
-                          : "terminated with unknown status");
+      << "' completed in state " << stringify(taskState)
+      << ": " << message.get();
 
     // Shutdown the executor if all the active child containers have terminated.
     if (containers.empty()) {

http://git-wip-us.apache.org/repos/asf/mesos/blob/079051d6/support/push-commits.py
----------------------------------------------------------------------
diff --git a/support/push-commits.py b/support/push-commits.py
index 4835d67..8a7b3ce 100755
--- a/support/push-commits.py
+++ b/support/push-commits.py
@@ -114,7 +114,13 @@ if __name__ == '__main__':
 
     print 'Pushing commits to', remote
 
-    if not options['dry_run']:
+    if options['dry_run']:
+        check_output(['git',
+                      'push',
+                      '--dry-run',
+                      remote,
+                      'master:master'])
+    else:
         check_output(['git',
                       'push',
                       remote,


[2/2] mesos git commit: Added MESOS-8080 to the 1.3.2 CHANGELOG.

Posted by jp...@apache.org.
Added MESOS-8080 to the 1.3.2 CHANGELOG.


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

Branch: refs/heads/1.3.x
Commit: b6f6e7a13200d6bf3e9ce47ae4f0be0317281db4
Parents: 079051d
Author: James Peach <jp...@apache.org>
Authored: Fri Nov 3 10:54:45 2017 -0700
Committer: James Peach <jp...@apache.org>
Committed: Fri Nov 3 10:54:45 2017 -0700

----------------------------------------------------------------------
 CHANGELOG | 1 +
 1 file changed, 1 insertion(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/b6f6e7a1/CHANGELOG
----------------------------------------------------------------------
diff --git a/CHANGELOG b/CHANGELOG
index 6c69c70..410feae 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -15,6 +15,7 @@ All Issues:
   * [MESOS-7912] - Master WebUI not working in Chrome.
   * [MESOS-7926] - Abnormal termination of default executor can cause MesosContainerizer::destroy to fail.
   * [MESOS-7934] - OOM due to LibeventSSLSocket send incorrectly returning 0 after shutdown.
+  * [MESOS-8080] - The default executor does not propagate missing task exit status correctly.
   * [MESOS-8135] - Masters can lose track of tasks' executor IDs.