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

Method _statusUpdateAcknowledgement

src/slave/slave.cpp:5075–5142  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5073
5074
5075void Slave::_statusUpdateAcknowledgement(
5076 const Future<bool>& future,
5077 const TaskID& taskId,
5078 const FrameworkID& frameworkId,
5079 const UUID& uuid)
5080{
5081 // The future could fail if this is a duplicate status update acknowledgement.
5082 if (!future.isReady()) {
5083 LOG(ERROR) << "Failed to handle status update acknowledgement (UUID: "
5084 << uuid << ") for task " << taskId
5085 << " of framework " << frameworkId << ": "
5086 << (future.isFailed() ? future.failure() : "future discarded");
5087 return;
5088 }
5089
5090 VLOG(1) << "Task status update manager successfully handled status update"
5091 << " acknowledgement (UUID: " << uuid
5092 << ") for task " << taskId
5093 << " of framework " << frameworkId;
5094
5095 CHECK(state == RECOVERING || state == DISCONNECTED ||
5096 state == RUNNING || state == TERMINATING)
5097 << state;
5098
5099 Framework* framework = getFramework(frameworkId);
5100 if (framework == nullptr) {
5101 LOG(ERROR) << "Status update acknowledgement (UUID: " << uuid
5102 << ") for task " << taskId
5103 << " of unknown framework " << frameworkId;
5104 return;
5105 }
5106
5107 CHECK(framework->state == Framework::RUNNING ||
5108 framework->state == Framework::TERMINATING)
5109 << framework->state;
5110
5111 // Find the executor that has this update.
5112 Executor* executor = framework->getExecutor(taskId);
5113 if (executor == nullptr) {
5114 LOG(ERROR) << "Status update acknowledgement (UUID: " << uuid
5115 << ") for task " << taskId
5116 << " of unknown executor";
5117 return;
5118 }
5119
5120 CHECK(executor->state == Executor::REGISTERING ||
5121 executor->state == Executor::RUNNING ||
5122 executor->state == Executor::TERMINATING ||
5123 executor->state == Executor::TERMINATED)
5124 << executor->state;
5125
5126 // If the task has reached terminal state and all its updates have
5127 // been acknowledged, mark it completed.
5128 if (executor->terminatedTasks.contains(taskId) && !future.get()) {
5129 executor->completeTask(taskId);
5130 }
5131
5132 // Remove the executor if it has terminated and there are no more

Callers

nothing calls this directly

Calls 9

isReadyMethod · 0.80
isFailedMethod · 0.80
failureMethod · 0.80
getExecutorMethod · 0.80
completeTaskMethod · 0.80
incompleteTasksMethod · 0.80
idleMethod · 0.80
containsMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected