You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by mp...@apache.org on 2017/10/22 20:07:56 UTC

mesos git commit: Fixed missing `convertResourceFormat` cases in `master::updateSlave`.

Repository: mesos
Updated Branches:
  refs/heads/master d2132c2f0 -> b13c4c368


Fixed missing `convertResourceFormat` cases in `master::updateSlave`.

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


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

Branch: refs/heads/master
Commit: b13c4c3683fd6bad702a7fb9e24cfc3414b921da
Parents: d2132c2
Author: Zhitao Li <zh...@gmail.com>
Authored: Sun Oct 22 12:54:15 2017 -0700
Committer: Michael Park <mp...@apache.org>
Committed: Sun Oct 22 12:56:11 2017 -0700

----------------------------------------------------------------------
 src/master/master.cpp | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/b13c4c36/src/master/master.cpp
----------------------------------------------------------------------
diff --git a/src/master/master.cpp b/src/master/master.cpp
index 3603878..4b76648 100644
--- a/src/master/master.cpp
+++ b/src/master/master.cpp
@@ -6798,8 +6798,19 @@ void Master::updateSlave(const UpdateSlaveMessage& message)
   Option<Resources> newTotal;
   Option<Resources> newOversubscribed;
 
+  // Make a copy of the message so we can transform its resources.
+  UpdateSlaveMessage message_(message);
+
+  convertResourceFormat(
+      message_.mutable_oversubscribed_resources(),
+      POST_RESERVATION_REFINEMENT);
+
+  convertResourceFormat(
+      message_.mutable_total_resources(),
+      POST_RESERVATION_REFINEMENT);
+
   if (hasTotal) {
-    const Resources& totalResources = message.total_resources();
+    const Resources& totalResources = message_.total_resources();
 
     LOG(INFO) << "Received update of agent " << *slave << " with total"
               << " resources " << totalResources;
@@ -6812,7 +6823,7 @@ void Master::updateSlave(const UpdateSlaveMessage& message)
   // independently apply it regardless of whether `total` was sent.
   if (hasOversubscribed) {
     const Resources& oversubscribedResources =
-      message.oversubscribed_resources();
+      message_.oversubscribed_resources();
 
     LOG(INFO) << "Received update of agent " << *slave << " with total"
               << " oversubscribed resources " << oversubscribedResources;