You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by bm...@apache.org on 2016/08/23 21:30:08 UTC

[1/2] mesos git commit: Documented 'Kill' behavior for task groups.

Repository: mesos
Updated Branches:
  refs/heads/master dcc8bd7d2 -> 963c1ff9c


Documented 'Kill' behavior for task groups.

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


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

Branch: refs/heads/master
Commit: 40e1a56fc6195a23d91add4b524ff001fe0c73ea
Parents: dcc8bd7
Author: Benjamin Mahler <bm...@apache.org>
Authored: Mon Aug 22 19:48:21 2016 -0700
Committer: Benjamin Mahler <bm...@apache.org>
Committed: Tue Aug 23 14:29:29 2016 -0700

----------------------------------------------------------------------
 include/mesos/scheduler/scheduler.proto    | 7 +++++++
 include/mesos/v1/scheduler/scheduler.proto | 7 +++++++
 2 files changed, 14 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/40e1a56f/include/mesos/scheduler/scheduler.proto
----------------------------------------------------------------------
diff --git a/include/mesos/scheduler/scheduler.proto b/include/mesos/scheduler/scheduler.proto
index ac5bce9..0576d90 100644
--- a/include/mesos/scheduler/scheduler.proto
+++ b/include/mesos/scheduler/scheduler.proto
@@ -287,6 +287,13 @@ message Call {
   // receives a terminal update (See TaskState in mesos.proto) for it.
   // If the task is unknown to the master, a TASK_LOST update is
   // generated.
+  //
+  // If a task within a task group is killed before the group is
+  // delivered to the executor, all tasks in the task group are
+  // killed. When a task group has been delivered to the executor,
+  // it is up to the executor to decide how to deal with the kill.
+  // Note The default Mesos executor will currently kill all the
+  // tasks in the task group if it gets a kill for any task.
   message Kill {
     required TaskID task_id = 1;
     optional SlaveID slave_id = 2;

http://git-wip-us.apache.org/repos/asf/mesos/blob/40e1a56f/include/mesos/v1/scheduler/scheduler.proto
----------------------------------------------------------------------
diff --git a/include/mesos/v1/scheduler/scheduler.proto b/include/mesos/v1/scheduler/scheduler.proto
index 05ff0e1..a922a7f 100644
--- a/include/mesos/v1/scheduler/scheduler.proto
+++ b/include/mesos/v1/scheduler/scheduler.proto
@@ -277,6 +277,13 @@ message Call {
   // receives a terminal update (See TaskState in v1/mesos.proto) for
   // it. If the task is unknown to the master, a TASK_LOST update is
   // generated.
+  //
+  // If a task within a task group is killed before the group is
+  // delivered to the executor, all tasks in the task group are
+  // killed. When a task group has been delivered to the executor,
+  // it is up to the executor to decide how to deal with the kill.
+  // Note The default Mesos executor will currently kill all the
+  // tasks in the task group if it gets a kill for any task.
   message Kill {
     required TaskID task_id = 1;
     optional AgentID agent_id = 2;


[2/2] mesos git commit: Added a CHECK for resource consumption invariant when launching task.

Posted by bm...@apache.org.
Added a CHECK for resource consumption invariant when launching task.

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


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

Branch: refs/heads/master
Commit: 963c1ff9cd9443f6a2fa8ab389da7f9287a4c1ef
Parents: 40e1a56
Author: Benjamin Mahler <bm...@apache.org>
Authored: Mon Aug 22 20:30:23 2016 -0700
Committer: Benjamin Mahler <bm...@apache.org>
Committed: Tue Aug 23 14:29:55 2016 -0700

----------------------------------------------------------------------
 src/master/master.cpp | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/963c1ff9/src/master/master.cpp
----------------------------------------------------------------------
diff --git a/src/master/master.cpp b/src/master/master.cpp
index d94a851..f62be4e 100644
--- a/src/master/master.cpp
+++ b/src/master/master.cpp
@@ -3840,7 +3840,12 @@ void Master::_accept(
 
           // Add task.
           if (pending) {
-            _offeredResources -= addTask(task_, framework, slave);
+            const Resources consumed = addTask(task_, framework, slave);
+
+            CHECK(_offeredResources.contains(consumed))
+              << _offeredResources << " does not contain " << consumed;
+
+            _offeredResources -= consumed;
 
             // TODO(bmahler): Consider updating this log message to
             // indicate when the executor is also being launched.