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

Method statusUpdateAcknowledgement

src/slave/slave.cpp:5024–5072  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5022
5023
5024void Slave::statusUpdateAcknowledgement(
5025 const UPID& from,
5026 const SlaveID& slaveId,
5027 const FrameworkID& frameworkId,
5028 const TaskID& taskId,
5029 const string& uuid)
5030{
5031 // Originally, all status update acknowledgements were sent from the
5032 // scheduler driver. We'd like to have all acknowledgements sent by
5033 // the master instead. See: MESOS-1389.
5034 // For now, we handle acknowledgements from the leading master and
5035 // from the scheduler driver, for backwards compatibility.
5036 // TODO(bmahler): Aim to have the scheduler driver no longer
5037 // sending acknowledgements in 0.20.0. Stop handling those messages
5038 // here in 0.21.0.
5039 // NOTE: We must reject those acknowledgements coming from
5040 // non-leading masters because we may have already sent the terminal
5041 // un-acknowledged task to the leading master! Unfortunately, the
5042 // master's pid will not change across runs on the same machine, so
5043 // we may process a message from the old master on the same machine,
5044 // but this is a more general problem!
5045 if (strings::startsWith(from.id, "master")) {
5046 if (state != RUNNING) {
5047 LOG(WARNING) << "Dropping status update acknowledgement message for "
5048 << frameworkId << " because the agent is in "
5049 << state << " state";
5050 return;
5051 }
5052
5053 if (master != from) {
5054 LOG(WARNING) << "Ignoring status update acknowledgement message from "
5055 << from << " because it is not the expected master: "
5056 << (master.isSome() ? stringify(master.get()) : "None");
5057 return;
5058 }
5059 }
5060
5061 UUID uuid_;
5062 uuid_.set_value(uuid);
5063
5064 taskStatusUpdateManager->acknowledgement(
5065 taskId, frameworkId, id::UUID::fromBytes(uuid).get())
5066 .onAny(defer(self(),
5067 &Slave::_statusUpdateAcknowledgement,
5068 lambda::_1,
5069 taskId,
5070 frameworkId,
5071 uuid_));
5072}
5073
5074
5075void Slave::_statusUpdateAcknowledgement(

Callers

nothing calls this directly

Calls 6

startsWithFunction · 0.85
deferFunction · 0.85
stringifyFunction · 0.50
isSomeMethod · 0.45
getMethod · 0.45
acknowledgementMethod · 0.45

Tested by

no test coverage detected