Repository: mesos
Updated Branches:
  refs/heads/master 0c21277b6 -> b5708315d


Ensured the scheduler driver IDs are unique.

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


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

Branch: refs/heads/master
Commit: b5708315d85ad6780d2dba264f1a6f40a2593d51
Parents: 0c21277
Author: Dominic Hamon <dha...@twopensource.com>
Authored: Tue Jun 17 15:16:53 2014 -0700
Committer: Benjamin Mahler <bmah...@twitter.com>
Committed: Tue Jun 17 15:19:23 2014 -0700

----------------------------------------------------------------------
 src/sched/sched.cpp | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/b5708315/src/sched/sched.cpp
----------------------------------------------------------------------
diff --git a/src/sched/sched.cpp b/src/sched/sched.cpp
index aa19735..a82a39d 100644
--- a/src/sched/sched.cpp
+++ b/src/sched/sched.cpp
@@ -108,7 +108,17 @@ public:
                    MasterDetector* _detector,
                    pthread_mutex_t* _mutex,
                    pthread_cond_t* _cond)
-    : ProcessBase(ID::generate("scheduler")),
+      // We use a UUID here to ensure that the master can reliably
+      // distinguish between scheduler runs. Otherwise the master may
+      // receive a delayed ExitedEvent enqueued behind a
+      // re-registration, and deactivate the framework incorrectly.
+      // TODO(bmahler): Investigate better ways to solve this problem.
+      // Check if bidirectional links in Erlang provides better
+      // semantics:
+      // http://www.erlang.org/doc/reference_manual/processes.html#id84804.
+      // Consider using unique PIDs throughout libprocess and relying
+      // on name registration to identify the process without the PID.
+    : ProcessBase("scheduler-" + UUID::random().toString()),
       metrics(*this),
       driver(_driver),
       scheduler(_scheduler),

Reply via email to