| 5073 | |
| 5074 | |
| 5075 | void 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 |
nothing calls this directly
no test coverage detected