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

Method acknowledgeOperationStatus

src/master/master.cpp:5923–6053  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5921
5922
5923void Master::acknowledgeOperationStatus(
5924 Framework* framework,
5925 scheduler::Call::AcknowledgeOperationStatus&& acknowledge)
5926{
5927 CHECK_NOTNULL(framework);
5928
5929 metrics->messages_operation_status_update_acknowledgement++;
5930
5931 const OperationID& operationId = acknowledge.operation_id();
5932
5933 Try<id::UUID> statusUuid_ = id::UUID::fromBytes(acknowledge.uuid());
5934
5935 CHECK_SOME(statusUuid_);
5936 const id::UUID statusUuid = statusUuid_.get();
5937
5938 CHECK(acknowledge.has_slave_id());
5939 const SlaveID& slaveId = acknowledge.slave_id();
5940
5941 Slave* slave = slaves.registered.get(slaveId);
5942 if (slave == nullptr) {
5943 LOG(WARNING)
5944 << "Cannot send operation status update acknowledgement for status "
5945 << statusUuid << " of operation '" << operationId << "'"
5946 << " of framework " << *framework << " to agent " << slaveId
5947 << " because agent is not registered";
5948
5949 metrics->invalid_operation_status_update_acknowledgements++;
5950 return;
5951 }
5952
5953 if (!slave->connected) {
5954 LOG(WARNING)
5955 << "Cannot send operation status update acknowledgement for status "
5956 << statusUuid << " of operation '" << operationId << "'"
5957 << " of framework " << *framework << " to agent " << slaveId
5958 << " because agent is disconnected";
5959
5960 metrics->invalid_operation_status_update_acknowledgements++;
5961 return;
5962 }
5963
5964 if (acknowledge.has_resource_provider_id() &&
5965 !slave->capabilities.resourceProvider) {
5966 LOG(WARNING)
5967 << "Cannot send operation status update acknowledgement for status "
5968 << statusUuid << " of operation '" << operationId << "'"
5969 << " of framework " << *framework << " to agent " << slaveId
5970 << " because the agent does not have the RESOURCE_PROVIDER"
5971 << " capability";
5972
5973 metrics->invalid_operation_status_update_acknowledgements++;
5974 return;
5975 }
5976
5977 if (!acknowledge.has_resource_provider_id() &&
5978 !slave->capabilities.agentOperationFeedback) {
5979 LOG(WARNING)
5980 << "Cannot send operation status update acknowledgement for status "

Callers 2

schedulerMethod · 0.45

Calls 10

isTerminalStateFunction · 0.85
toBytesMethod · 0.80
sendFunction · 0.50
getMethod · 0.45
isNoneMethod · 0.45
getOperationMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
valueMethod · 0.45
stateMethod · 0.45

Tested by

no test coverage detected