Repository: mesos Updated Branches: refs/heads/master 4f297654f -> 6f2a452d4
Libprocess: Added id to the Sequence c-tor. Sequence IDs used to be tagged as "(1)", "(2)", etc. This made it very hard to match the output from logging or the "__processes__" endpoint to actors. This change makes it possible to give sequence processes a distinguishable ID and updates c-tor invocation sites. Review: https://reviews.apache.org/r/50637/ Project: http://git-wip-us.apache.org/repos/asf/mesos/repo Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/987fdef0 Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/987fdef0 Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/987fdef0 Branch: refs/heads/master Commit: 987fdef0b2a71a49f17c9f250abb4b510dfba919 Parents: 4f29765 Author: Gastón Kleiman <gas...@mesosphere.com> Authored: Wed Aug 3 13:18:19 2016 +0200 Committer: Alexander Rukletsov <al...@apache.org> Committed: Wed Aug 3 13:45:05 2016 +0200 ---------------------------------------------------------------------- 3rdparty/libprocess/include/process/sequence.hpp | 11 +++++++---- 3rdparty/libprocess/src/process.cpp | 4 ++-- 2 files changed, 9 insertions(+), 6 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/mesos/blob/987fdef0/3rdparty/libprocess/include/process/sequence.hpp ---------------------------------------------------------------------- diff --git a/3rdparty/libprocess/include/process/sequence.hpp b/3rdparty/libprocess/include/process/sequence.hpp index 78ccdb9..c9a46f2 100644 --- a/3rdparty/libprocess/include/process/sequence.hpp +++ b/3rdparty/libprocess/include/process/sequence.hpp @@ -16,6 +16,7 @@ #include <glog/logging.h> #include <process/future.hpp> +#include <process/id.hpp> #include <process/owned.hpp> #include <process/process.hpp> @@ -32,7 +33,7 @@ class SequenceProcess; class Sequence { public: - Sequence(); + Sequence(const std::string& id = "sequence"); ~Sequence(); // Registers a callback that will be invoked when all the futures @@ -62,7 +63,9 @@ private: class SequenceProcess : public Process<SequenceProcess> { public: - SequenceProcess() : last(Nothing()) {} + SequenceProcess(const std::string& id) + : ProcessBase(ID::generate(id)), + last(Nothing()) {} template <typename T> Future<T> add(const lambda::function<Future<T>()>& callback) @@ -163,9 +166,9 @@ private: }; -inline Sequence::Sequence() +inline Sequence::Sequence(const std::string& id) { - process = new SequenceProcess(); + process = new SequenceProcess(id); process::spawn(process); } http://git-wip-us.apache.org/repos/asf/mesos/blob/987fdef0/3rdparty/libprocess/src/process.cpp ---------------------------------------------------------------------- diff --git a/3rdparty/libprocess/src/process.cpp b/3rdparty/libprocess/src/process.cpp index 7f331b8..629f164 100644 --- a/3rdparty/libprocess/src/process.cpp +++ b/3rdparty/libprocess/src/process.cpp @@ -1176,7 +1176,7 @@ void HttpProxy::initialize() // constructor in order to prevent a deadlock between the // SocketManager and the ProcessManager (see the comment in // SocketManager::proxy). - authentications.reset(new Sequence()); + authentications.reset(new Sequence("__authentications__")); } @@ -3344,7 +3344,7 @@ void ProcessBase::visit(const HttpEvent& event) // Lazily initialize the Sequence needed for ordering requests // across authentication and authorization. if (handlers.httpSequence.get() == nullptr) { - handlers.httpSequence.reset(new Sequence()); + handlers.httpSequence.reset(new Sequence("__auth_handlers__")); } CHECK(event.request->url.path.find('/') == 0); // See ProcessManager::handle.