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

Method __statusUpdate

src/slave/slave.cpp:6348–6401  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6346
6347
6348void Slave::__statusUpdate(
6349 const Option<Future<Nothing>>& future,
6350 const StatusUpdate& update,
6351 const Option<UPID>& pid,
6352 const ExecutorID& executorId,
6353 const ContainerID& containerId,
6354 bool checkpoint)
6355{
6356 if (future.isSome() && !future->isReady()) {
6357 LOG(ERROR) << "Failed to update resources for container " << containerId
6358 << " of executor '" << executorId
6359 << "' running task " << update.status().task_id()
6360 << " on status update for terminal task, destroying container: "
6361 << (future->isFailed() ? future->failure() : "discarded");
6362
6363 containerizer->destroy(containerId);
6364
6365 Executor* executor = getExecutor(update.framework_id(), executorId);
6366 if (executor != nullptr) {
6367 Framework* framework = getFramework(update.framework_id());
6368 CHECK_NOTNULL(framework);
6369
6370 // Send TASK_GONE because the task was started but has now
6371 // been terminated. If the framework is not partition-aware,
6372 // we send TASK_LOST instead for backward compatibility.
6373 mesos::TaskState taskState = TASK_GONE;
6374 if (!framework->capabilities.partitionAware) {
6375 taskState = TASK_LOST;
6376 }
6377
6378 ContainerTermination termination;
6379 termination.set_state(taskState);
6380 termination.set_reason(TaskStatus::REASON_CONTAINER_UPDATE_FAILED);
6381 termination.set_message(
6382 "Failed to update resources for container: " +
6383 (future->isFailed() ? future->failure() : "discarded"));
6384
6385 executor->pendingTermination = termination;
6386
6387 // TODO(jieyu): Set executor->state to be TERMINATING.
6388 }
6389 }
6390
6391 if (checkpoint) {
6392 // Ask the task status update manager to checkpoint and reliably send the
6393 // update.
6394 taskStatusUpdateManager->update(update, info.id(), executorId, containerId)
6395 .onAny(defer(self(), &Slave::___statusUpdate, lambda::_1, update, pid));
6396 } else {
6397 // Ask the task status update manager to just retry the update.
6398 taskStatusUpdateManager->update(update, info.id())
6399 .onAny(defer(self(), &Slave::___statusUpdate, lambda::_1, update, pid));
6400 }
6401}
6402
6403
6404void Slave::___statusUpdate(

Callers

nothing calls this directly

Calls 9

deferFunction · 0.85
isReadyMethod · 0.80
isFailedMethod · 0.80
failureMethod · 0.80
isSomeMethod · 0.45
statusMethod · 0.45
destroyMethod · 0.45
updateMethod · 0.45
idMethod · 0.45

Tested by

no test coverage detected