You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by ji...@apache.org on 2017/12/05 03:56:30 UTC

[2/3] mesos git commit: Fixed resources tracking under roles when removing offer operations.

Fixed resources tracking under roles when removing offer operations.

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


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

Branch: refs/heads/master
Commit: 2fa447c5fb1ffcce1c08e4039d156513bdd5187d
Parents: dc8c8da
Author: Chun-Hung Hsiao <ch...@mesosphere.io>
Authored: Mon Dec 4 19:27:55 2017 -0800
Committer: Jie Yu <yu...@gmail.com>
Committed: Mon Dec 4 19:56:22 2017 -0800

----------------------------------------------------------------------
 src/master/master.cpp | 5 +++++
 src/master/master.hpp | 5 +++++
 2 files changed, 10 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/2fa447c5/src/master/master.cpp
----------------------------------------------------------------------
diff --git a/src/master/master.cpp b/src/master/master.cpp
index 883793a..31991b5 100644
--- a/src/master/master.cpp
+++ b/src/master/master.cpp
@@ -9241,6 +9241,11 @@ void Master::removeFramework(Framework* framework)
     }
   }
 
+  foreachvalue (OfferOperation* operation,
+                utils::copy(framework->offerOperations)) {
+    framework->removeOfferOperation(operation);
+  }
+
   // TODO(benh): Similar code between removeFramework and
   // failoverFramework needs to be shared!
 

http://git-wip-us.apache.org/repos/asf/mesos/blob/2fa447c5/src/master/master.hpp
----------------------------------------------------------------------
diff --git a/src/master/master.hpp b/src/master/master.hpp
index c3bc0b5..448be3b 100644
--- a/src/master/master.hpp
+++ b/src/master/master.hpp
@@ -2580,6 +2580,11 @@ struct Framework
       << "' (uuid: " << uuid->toString() << ") "
       << "of framework " << operation->framework_id();
 
+    if (!protobuf::isSpeculativeOperation(operation->info()) &&
+        !protobuf::isTerminalState(operation->latest_status().state())) {
+      recoverResources(operation);
+    }
+
     offerOperations.erase(uuid.get());
   }