MCPcopy Create free account
hub / github.com/apache/mesos / ___reregisterSlave

Method ___reregisterSlave

src/master/master.cpp:7209–7416  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7207
7208
7209void Master::___reregisterSlave(
7210 const process::UPID& pid,
7211 ReregisterSlaveMessage&& reregisterSlaveMessage,
7212 const process::Future<bool>& updated)
7213{
7214 const SlaveInfo& slaveInfo = reregisterSlaveMessage.slave();
7215 CHECK(slaves.reregistering.contains(slaveInfo.id()));
7216
7217 CHECK_READY(updated);
7218 CHECK(updated.get());
7219
7220 VLOG(1) << "Registry updated for slave " << slaveInfo.id() << " at " << pid
7221 << "(" << slaveInfo.hostname() << ")";
7222
7223 if (slaves.markingGone.contains(slaveInfo.id())) {
7224 LOG(INFO)
7225 << "Ignoring reregister agent message from agent "
7226 << slaveInfo.id() << " at " << pid << " ("
7227 << slaveInfo.hostname() << ") as a gone operation is already in progress";
7228
7229 slaves.reregistering.erase(slaveInfo.id());
7230 return;
7231 }
7232
7233 if (slaves.gone.contains(slaveInfo.id())) {
7234 LOG(WARNING) << "Refusing re-registration of agent at " << pid
7235 << " because it is already marked gone";
7236
7237 ShutdownMessage message;
7238 message.set_message("Agent has been marked gone");
7239 send(pid, message);
7240
7241 slaves.reregistering.erase(slaveInfo.id());
7242 return;
7243 }
7244
7245 if (!slaves.registered.contains(slaveInfo.id())) {
7246 LOG(WARNING)
7247 << "Dropping ongoing re-registration attempt of slave " << slaveInfo.id()
7248 << " at " << pid << "(" << slaveInfo.hostname() << ") "
7249 << "because the re-registration timeout was reached.";
7250
7251 slaves.reregistering.erase(slaveInfo.id());
7252 // Don't send a ShutdownMessage here because tasks from partition-aware
7253 // frameworks running on this host might still be recovered when the slave
7254 // retries the re-registration.
7255 return;
7256 }
7257
7258 Slave* slave = slaves.registered.get(slaveInfo.id());
7259
7260 // Update the slave pid and relink to it.
7261 // NOTE: Re-linking the slave here always rather than only when
7262 // the slave is disconnected can lead to multiple exited events
7263 // in succession for a disconnected slave. As a result, we
7264 // ignore duplicate exited events for disconnected slaves.
7265 // See: https://issues.apache.org/jira/browse/MESOS-675
7266 slave->pid = pid;

Callers

nothing calls this directly

Calls 15

downgradeResourcesFunction · 0.85
versionMethod · 0.80
CopyFromMethod · 0.80
atMethod · 0.80
errorMethod · 0.65
sendFunction · 0.50
convertFunction · 0.50
ResourcesClass · 0.50
dispatchFunction · 0.50
containsMethod · 0.45
idMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected