You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by be...@apache.org on 2012/02/01 01:58:37 UTC

svn commit: r1238890 - in /incubator/mesos/trunk/src/master: master.cpp master.hpp

Author: benh
Date: Wed Feb  1 00:58:36 2012
New Revision: 1238890

URL: http://svn.apache.org/viewvc?rev=1238890&view=rev
Log:
Cancel timerTick timers after Master dies (contributed by Charles Reiss).

Modified:
    incubator/mesos/trunk/src/master/master.cpp
    incubator/mesos/trunk/src/master/master.hpp

Modified: incubator/mesos/trunk/src/master/master.cpp
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/src/master/master.cpp?rev=1238890&r1=1238889&r2=1238890&view=diff
==============================================================================
--- incubator/mesos/trunk/src/master/master.cpp (original)
+++ incubator/mesos/trunk/src/master/master.cpp Wed Feb  1 00:58:36 2012
@@ -313,7 +313,7 @@ void Master::initialize()
   startTime = Clock::now();
 
   // Start our timer ticks.
-  delay(1.0, self(), &Master::timerTick);
+  timerTickTimer = delay(1.0, self(), &Master::timerTick);
 
   // Install handler functions for certain messages.
   install<SubmitSchedulerRequest>(
@@ -420,6 +420,8 @@ void Master::finalize()
   foreachvalue (Slave* slave, slaves) {
     send(slave->pid, ShutdownMessage());
   }
+
+  process::timers::cancel(timerTickTimer);
 }
 
 
@@ -1142,7 +1144,7 @@ void Master::timerTick()
   allocator->timerTick();
 
   // Scheduler another timer tick!
-  delay(1.0, self(), &Master::timerTick);
+  timerTickTimer = delay(1.0, self(), &Master::timerTick);
 }
 
 

Modified: incubator/mesos/trunk/src/master/master.hpp
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/src/master/master.hpp?rev=1238890&r1=1238889&r2=1238890&view=diff
==============================================================================
--- incubator/mesos/trunk/src/master/master.hpp (original)
+++ incubator/mesos/trunk/src/master/master.hpp Wed Feb  1 00:58:36 2012
@@ -24,6 +24,7 @@
 
 #include <process/process.hpp>
 #include <process/protobuf.hpp>
+#include <process/timer.hpp>
 
 #include "common/foreach.hpp"
 #include "common/hashmap.hpp"
@@ -228,6 +229,8 @@ private:
   } stats;
 
   double startTime; // Start time used to calculate uptime.
+
+  process::timer timerTickTimer;
 };