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/08 18:19:43 UTC
svn commit: r1241991 - /incubator/mesos/trunk/src/master/master.cpp
Author: benh
Date: Wed Feb 8 17:19:43 2012
New Revision: 1241991
URL: http://svn.apache.org/viewvc?rev=1241991&view=rev
Log:
Fix bug that crashed a master is a slave attempted to re-register with more than one task running in the same executor.
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=1241991&r1=1241990&r2=1241991&view=diff
==============================================================================
--- incubator/mesos/trunk/src/master/master.cpp (original)
+++ incubator/mesos/trunk/src/master/master.cpp Wed Feb 8 17:19:43 2012
@@ -1652,18 +1652,21 @@ void Master::readdSlave(Slave* slave,
foreach (const Task& task, tasks) {
Task* t = new Task(task);
- // Find the executor running this task and add it to the slave.
+ // Find the executor running this task and add the executor to the
+ // slave (unless it has already been added).
foreach (const ExecutorInfo& executorInfo, executorInfos) {
if (executorInfo.executor_id() == task.executor_id()) {
if (!slave->hasExecutor(task.framework_id(), task.executor_id())) {
slave->addExecutor(task.framework_id(), executorInfo);
}
- // Also add it to the framework if it has re-registered with us.
+ // Also try to add the executor to the framework if the
+ // framework has re-registered with this master.
Framework* framework = getFramework(task.framework_id());
if (framework != NULL) {
- CHECK(!framework->hasExecutor(slave->id, task.executor_id()));
- framework->addExecutor(slave->id, executorInfo);
+ if (!framework->hasExecutor(slave->id, task.executor_id())) {
+ framework->addExecutor(slave->id, executorInfo);
+ }
}
break;
}