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 05:23:30 UTC
svn commit: r1131564 - in /incubator/mesos/trunk/src: master.cpp
messages.hpp slave.cpp
Author: benh
Date: Sun Jun 5 03:23:30 2011
New Revision: 1131564
URL: http://svn.apache.org/viewvc?rev=1131564&view=rev
Log:
Fixed a bug that would create a new isolation module upon master reconnect
Modified:
incubator/mesos/trunk/src/master.cpp
incubator/mesos/trunk/src/messages.hpp
incubator/mesos/trunk/src/slave.cpp
Modified: incubator/mesos/trunk/src/master.cpp
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/src/master.cpp?rev=1131564&r1=1131563&r2=1131564&view=diff
==============================================================================
--- incubator/mesos/trunk/src/master.cpp (original)
+++ incubator/mesos/trunk/src/master.cpp Sun Jun 5 03:23:30 2011
@@ -319,27 +319,6 @@ void Master::operator () ()
break;
}
- case F2M_REREGISTER_FRAMEWORK: {
-
- Framework *framework = new Framework(from());
- unpack<F2M_REREGISTER_FRAMEWORK>(framework->id,
- framework->name,
- framework->user,
- framework->executorInfo);
- LOG(INFO) << "Registering " << framework << " at " << framework->pid;
- frameworks[framework->id] = framework;
- pidToFid[framework->pid] = framework->id;
-
- updateFrameworkTasks();
-
- link(framework->pid);
- send(framework->pid, pack<M2F_REGISTER_REPLY>(framework->id));
- allocator->frameworkAdded(framework);
- if (framework->executorInfo.uri == "")
- terminateFramework(framework, 1, "No executor URI given");
- break;
- }
-
case F2M_UNREGISTER_FRAMEWORK: {
FrameworkID fid;
unpack<F2M_UNREGISTER_FRAMEWORK>(fid);
@@ -448,7 +427,7 @@ void Master::operator () ()
slaves[slave->id] = slave;
pidToSid[slave->pid] = slave->id;
link(slave->pid);
- send(slave->pid, pack<M2S_REGISTER_REPLY>(slave->id));
+ send(slave->pid, pack<M2S_REREGISTER_REPLY>());
allocator->slaveAdded(slave);
break;
}
Modified: incubator/mesos/trunk/src/messages.hpp
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/src/messages.hpp?rev=1131564&r1=1131563&r2=1131564&view=diff
==============================================================================
--- incubator/mesos/trunk/src/messages.hpp (original)
+++ incubator/mesos/trunk/src/messages.hpp Sun Jun 5 03:23:30 2011
@@ -52,6 +52,7 @@ enum MessageType {
/* From master to slave. */
M2S_REGISTER_REPLY,
+ M2S_REREGISTER_REPLY,
M2S_RUN_TASK,
M2S_KILL_TASK,
M2S_KILL_FRAMEWORK,
@@ -202,6 +203,9 @@ TUPLE(LE_NEWLEADER,
TUPLE(M2S_REGISTER_REPLY,
(SlaveID));
+TUPLE(M2S_REREGISTER_REPLY,
+ ());
+
TUPLE(M2S_RUN_TASK,
(FrameworkID,
TaskID,
Modified: incubator/mesos/trunk/src/slave.cpp
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/src/slave.cpp?rev=1131564&r1=1131563&r2=1131564&view=diff
==============================================================================
--- incubator/mesos/trunk/src/slave.cpp (original)
+++ incubator/mesos/trunk/src/slave.cpp Sun Jun 5 03:23:30 2011
@@ -191,6 +191,12 @@ void Slave::operator () ()
break;
}
+ case M2S_REREGISTER_REPLY: {
+ LOG(INFO) << "Registered with master; given slave ID " << this->id;
+ link(spawn(new Heart(master, this->getPID(), this->id)));
+ break;
+ }
+
case M2S_RUN_TASK: {
string fwName, user, taskName, taskArg;
ExecutorInfo execInfo;