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 2018/09/05 00:16:18 UTC

[mesos] branch master updated: Eliminated a copy of outgoing offers in the master.

This is an automated email from the ASF dual-hosted git repository.

bmahler pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mesos.git


The following commit(s) were added to refs/heads/master by this push:
     new 38b59ce  Eliminated a copy of outgoing offers in the master.
38b59ce is described below

commit 38b59cec824ca7ac04e77f4ce00e7740216d69c9
Author: Benjamin Mahler <bm...@apache.org>
AuthorDate: Mon Sep 3 22:17:47 2018 -0700

    Eliminated a copy of outgoing offers in the master.
    
    Review: https://reviews.apache.org/r/68618
---
 src/master/master.cpp | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/master/master.cpp b/src/master/master.cpp
index cec2041..e307df0 100644
--- a/src/master/master.cpp
+++ b/src/master/master.cpp
@@ -9395,16 +9395,16 @@ void Master::offer(
             offer_.mutable_resources(), PRE_RESERVATION_REFINEMENT);
       }
 
-      // Add the offer *AND* the corresponding slave's PID.
-      message.add_offers()->MergeFrom(offer_);
-      message.add_pids(slave->pid);
-
-      offerIds.push_back(offer_.id());
-
       VLOG(2) << "Sending offer " << offer_.id()
               << " containing resources " << offered
               << " on agent " << *slave
               << " to framework " << *framework;
+
+      offerIds.push_back(offer_.id());
+
+      // Add the offer *AND* the corresponding slave's PID.
+      *message.add_offers() = std::move(offer_);
+      message.add_pids(slave->pid);
     }
   }