You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by vi...@apache.org on 2014/06/24 20:24:13 UTC

git commit: Explicitly terminated scheduler process in ~MesosSchedulerDriver().

Repository: mesos
Updated Branches:
  refs/heads/master d47b1d91d -> 6f32d9a17


Explicitly terminated scheduler process in ~MesosSchedulerDriver().

Without this fix, Mesos tests that have assert failures get deadlocked
on ~MesosSchedulerDriver() (because driver.stop() is not called)
waiting forever for the scheduler process to exit. This causes the
tests to never exit.

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


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

Branch: refs/heads/master
Commit: 6f32d9a17f1a08d8d85caca5177fc4c43d6839db
Parents: d47b1d9
Author: Vinod Kone <vi...@gmail.com>
Authored: Tue Jun 24 11:22:30 2014 -0700
Committer: Vinod Kone <vi...@gmail.com>
Committed: Tue Jun 24 11:22:31 2014 -0700

----------------------------------------------------------------------
 src/sched/sched.cpp | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/6f32d9a1/src/sched/sched.cpp
----------------------------------------------------------------------
diff --git a/src/sched/sched.cpp b/src/sched/sched.cpp
index 869f50a..c2da5bb 100644
--- a/src/sched/sched.cpp
+++ b/src/sched/sched.cpp
@@ -1194,11 +1194,14 @@ MesosSchedulerDriver::~MesosSchedulerDriver()
   // method of the Scheduler instance that is being destructed! Note
   // that we could add a method to libprocess that told us whether or
   // not this was about to be deadlock, and possibly report this back
-  // to the user somehow. Note that we will also wait forever if
-  // MesosSchedulerDriver::stop was never called. It might make sense
-  // to try and add some more debug output for the case where we wait
-  // indefinitely due to deadlock ...
+  // to the user somehow. It might make sense to try and add some more
+  // debug output for the case where we wait indefinitely due to
+  // deadlock.
   if (process != NULL) {
+    // We call 'terminate()' here to ensure that SchedulerProcess
+    // terminates even if the user forgot to call stop/abort on the
+    // driver.
+    terminate(process);
     wait(process);
     delete process;
   }