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 2013/03/13 19:12:21 UTC
svn commit: r1456069 - /incubator/mesos/trunk/src/slave/slave.cpp
Author: vinodkone
Date: Wed Mar 13 18:12:20 2013
New Revision: 1456069
URL: http://svn.apache.org/r1456069
Log:
Fixed a bug in the slave to only send UnregisteredSlave message
when it is connected to a master and is registered.
Review: https://reviews.apache.org/r/9904
Modified:
incubator/mesos/trunk/src/slave/slave.cpp
Modified: incubator/mesos/trunk/src/slave/slave.cpp
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/src/slave/slave.cpp?rev=1456069&r1=1456068&r2=1456069&view=diff
==============================================================================
--- incubator/mesos/trunk/src/slave/slave.cpp (original)
+++ incubator/mesos/trunk/src/slave/slave.cpp Wed Mar 13 18:12:20 2013
@@ -416,9 +416,11 @@ void Slave::finalize()
// But since the master no longer removes the slave when a slave exits, we
// send an UnregisterSlaveMessage to master so that it removes the slave.
// This is OK because, finalize() is only ever going to be called in tests!
- UnregisterSlaveMessage message;
- message.mutable_slave_id()->CopyFrom(info.id());
- send(master, message);
+ if (master && info.has_id()) {
+ UnregisterSlaveMessage message;
+ message.mutable_slave_id()->CopyFrom(info.id());
+ send(master, message);
+ }
}