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 2011/06/05 11:04:24 UTC

svn commit: r1132229 - /incubator/mesos/trunk/src/master/master.cpp

Author: benh
Date: Sun Jun  5 09:04:23 2011
New Revision: 1132229

URL: http://svn.apache.org/viewvc?rev=1132229&view=rev
Log:
Bug fix due to regression introduced when framework structs got reused instead of new ones being created (see commit #171d96cbd0e68f68c60f) which caused the framework failover timer to not properly get destroyed.

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

Modified: incubator/mesos/trunk/src/master/master.cpp
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/src/master/master.cpp?rev=1132229&r1=1132228&r2=1132229&view=diff
==============================================================================
--- incubator/mesos/trunk/src/master/master.cpp (original)
+++ incubator/mesos/trunk/src/master/master.cpp Sun Jun  5 09:04:23 2011
@@ -788,7 +788,7 @@ void Master::operator () ()
 
       Framework* framework = lookupFramework(msg.framework_id());
       if (framework != NULL) {
-	LOG(INFO) << "Framework failover timer expired, removing framework "
+	LOG(INFO) << "Framework failover timer expired, removing "
 		  << framework;
 	removeFramework(framework);
       }
@@ -822,8 +822,8 @@ void Master::operator () ()
 	foreachpair (_, Framework *framework, frameworks) {
 	  if (framework->failoverTimer != NULL &&
 	      framework->failoverTimer->self() == from()) {
-	    LOG(INFO) << "Lost framework failover timer, removing framework "
-		      << framework;
+	    LOG(ERROR) << "Bad framework failover timer, removing "
+		       << framework;
 	    removeFramework(framework);
 	    break;
 	  }
@@ -1178,6 +1178,14 @@ void Master::failoverFramework(Framework
   framework->pid = newPid;
   link(newPid);
 
+  // Kill the failover timer.
+  if (framework->failoverTimer != NULL) {
+    send(framework->failoverTimer->self(), M2M_SHUTDOWN);
+    wait(framework->failoverTimer->self());
+    delete framework->failoverTimer;
+    framework->failoverTimer = NULL;
+  }
+
   // Make sure we can get offers again.
   framework->active = true;