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

[2/2] mesos git commit: Made explicit that we dispatch to a process manager.

Made explicit that we dispatch to a process manager.

This member function of 'ProcessManager' was capturing a 'this'
pointer when dispatching to itself, but did not properly use 'defer'
or 'dispatch'. While this pattern is usually suspect, it was safe here
as we can be sure that the process manager lives long enough to safely
invoke the created callback.

This patch removes the capture of 'this' and instead explicitly
references the 'static process_manager' in the created callback to
signal that we rely on external invariants.

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


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

Branch: refs/heads/master
Commit: 7b0852f793311a0a1d41eec9f0aaaebf90e9ddd5
Parents: 01c5398
Author: Benjamin Bannier <bb...@apache.org>
Authored: Wed Sep 27 09:59:59 2017 +0200
Committer: Benjamin Bannier <bb...@apache.org>
Committed: Wed Sep 27 09:59:59 2017 +0200

----------------------------------------------------------------------
 3rdparty/libprocess/src/process.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/7b0852f7/3rdparty/libprocess/src/process.cpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/src/process.cpp b/3rdparty/libprocess/src/process.cpp
index 7aba8f0..a81ef74 100644
--- a/3rdparty/libprocess/src/process.cpp
+++ b/3rdparty/libprocess/src/process.cpp
@@ -2953,7 +2953,7 @@ void ProcessManager::handle(
     // from `SocketManager::finalize()` due to it closing all active sockets
     // during libprocess finalization.
     parse(*request)
-      .onAny([this, socket, request](const Future<MessageEvent*>& future) {
+      .onAny([socket, request](const Future<MessageEvent*>& future) {
         // Get the HttpProxy pid for this socket.
         PID<HttpProxy> proxy = socket_manager->proxy(socket);
 
@@ -3003,7 +3003,7 @@ void ProcessManager::handle(
 
         // TODO(benh): Use the sender PID when delivering in order to
         // capture happens-before timing relationships for testing.
-        bool accepted = deliver(event->message.to, event);
+        bool accepted = process_manager->deliver(event->message.to, event);
 
         // NOTE: prior to commit d5fe51c on April 11, 2014 we needed
         // to ignore sending responses in the event the receiver was a