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

Method reconcile

src/master/master.cpp:8939–9152  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8937
8938
8939void Master::reconcile(
8940 Framework* framework,
8941 scheduler::Call::Reconcile&& reconcile)
8942{
8943 CHECK_NOTNULL(framework);
8944
8945 ++metrics->messages_reconcile_tasks;
8946
8947 if (reconcile.tasks().empty()) {
8948 // Implicit reconciliation.
8949 LOG(INFO) << "Performing implicit task state reconciliation"
8950 " for framework " << *framework;
8951
8952 foreachvalue (Task* task, framework->tasks) {
8953 const TaskState& state = task->has_status_update_state()
8954 ? task->status_update_state()
8955 : task->state();
8956
8957 const Option<ExecutorID>& executorId = task->has_executor_id()
8958 ? Option<ExecutorID>(task->executor_id())
8959 : None();
8960
8961 StatusUpdate update = protobuf::createStatusUpdate(
8962 framework->id(),
8963 task->slave_id(),
8964 task->task_id(),
8965 state,
8966 TaskStatus::SOURCE_MASTER,
8967 None(),
8968 "Reconciliation: Latest task state",
8969 TaskStatus::REASON_RECONCILIATION,
8970 executorId,
8971 protobuf::getTaskHealth(*task),
8972 protobuf::getTaskCheckStatus(*task),
8973 None(),
8974 protobuf::getTaskContainerStatus(*task));
8975
8976 VLOG(1) << "Sending implicit reconciliation state "
8977 << update.status().state()
8978 << " for task " << update.status().task_id()
8979 << " of framework " << *framework;
8980
8981 // TODO(bmahler): Consider using forward(); might lead to too
8982 // much logging.
8983 StatusUpdateMessage message;
8984 *message.mutable_update() = std::move(update);
8985 framework->send(message);
8986 }
8987
8988 return;
8989 }
8990
8991 // Explicit reconciliation.
8992 LOG(INFO) << "Performing explicit task state reconciliation"
8993 << " for " << reconcile.tasks().size() << " tasks"
8994 << " of framework " << *framework;
8995
8996 // Explicit reconciliation occurs for the following cases:

Callers 1

schedulerMethod · 0.45

Calls 13

NoneClass · 0.85
createStatusUpdateFunction · 0.85
getTaskHealthFunction · 0.85
getTaskCheckStatusFunction · 0.85
getTaskContainerStatusFunction · 0.85
foreachvalueFunction · 0.70
sendMethod · 0.65
emptyMethod · 0.45
tasksMethod · 0.45
stateMethod · 0.45
idMethod · 0.45
statusMethod · 0.45

Tested by

no test coverage detected