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

mesos git commit: Quota: Made allocator's pause/resume idempotent.

Repository: mesos
Updated Branches:
  refs/heads/master 10f8052c7 -> 7c5e89ed7


Quota: Made allocator's pause/resume idempotent.

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


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

Branch: refs/heads/master
Commit: 7c5e89ed704c02f3d00dc5742de0cf7ef9989c3b
Parents: 10f8052
Author: Alexander Rukletsov <ru...@gmail.com>
Authored: Wed Jan 20 23:45:29 2016 -0800
Committer: Joris Van Remoortere <jo...@gmail.com>
Committed: Wed Jan 20 23:46:32 2016 -0800

----------------------------------------------------------------------
 src/master/allocator/mesos/hierarchical.cpp | 16 ++++++++--------
 src/master/allocator/mesos/hierarchical.hpp |  2 +-
 2 files changed, 9 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/7c5e89ed/src/master/allocator/mesos/hierarchical.cpp
----------------------------------------------------------------------
diff --git a/src/master/allocator/mesos/hierarchical.cpp b/src/master/allocator/mesos/hierarchical.cpp
index e32ee4a..53d8784 100644
--- a/src/master/allocator/mesos/hierarchical.cpp
+++ b/src/master/allocator/mesos/hierarchical.cpp
@@ -1045,21 +1045,21 @@ void HierarchicalAllocatorProcess::removeQuota(
 
 void HierarchicalAllocatorProcess::pause()
 {
-  CHECK(!paused);
+  if (!paused) {
+    VLOG(1) << "Allocation paused";
 
-  VLOG(1) << "Allocation paused";
-
-  paused = true;
+    paused = true;
+  }
 }
 
 
 void HierarchicalAllocatorProcess::resume()
 {
-  CHECK(paused);
-
-  VLOG(1) << "Allocation resumed";
+  if (paused) {
+    VLOG(1) << "Allocation resumed";
 
-  paused = false;
+    paused = false;
+  }
 }
 
 

http://git-wip-us.apache.org/repos/asf/mesos/blob/7c5e89ed/src/master/allocator/mesos/hierarchical.hpp
----------------------------------------------------------------------
diff --git a/src/master/allocator/mesos/hierarchical.hpp b/src/master/allocator/mesos/hierarchical.hpp
index 1014821..18f77bc 100644
--- a/src/master/allocator/mesos/hierarchical.hpp
+++ b/src/master/allocator/mesos/hierarchical.hpp
@@ -192,7 +192,7 @@ protected:
   typedef HierarchicalAllocatorProcess Self;
   typedef HierarchicalAllocatorProcess This;
 
-  // Helpers for pausing and resuming allocation.
+  // Idempotent helpers for pausing and resuming allocation.
   void pause();
   void resume();