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:09 UTC

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

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.