void statusUpdate(const StatusUpdate& update, const UPID& pid) { const TaskStatus& status = update.status(); VLOG(1) << "Status update: task " << status.task_id() << " of framework " << update.framework_id() << " is now in state " << status.state(); CHECK(frameworkId == update.framework_id()); // TODO(benh): Note that this maybe a duplicate status update! // Once we get support to try and have a more consistent view // of what's running in the cluster, we'll just let this one // slide. The alternative is possibly dealing with a scheduler // failover and not correctly giving the scheduler it's status // update, which seems worse than giving a status update // multiple times (of course, if a scheduler re-uses a TaskID, // that could be bad. invoke(bind(&Scheduler::statusUpdate, sched, driver, cref(status))); if (pid) { // Acknowledge the message (we do this last, after we invoked // the scheduler, if we did at all, in case it causes a crash, // since this way the message might get resent/routed after the // scheduler comes back online). StatusUpdateAcknowledgementMessage message; message.mutable_framework_id()->MergeFrom(frameworkId); message.mutable_slave_id()->MergeFrom(update.slave_id()); message.mutable_task_id()->MergeFrom(status.task_id()); message.set_uuid(update.uuid()); send(pid, message); } }
v1::executor::Event evolve( const StatusUpdateAcknowledgementMessage& message) { v1::executor::Event event; event.set_type(v1::executor::Event::ACKNOWLEDGED); v1::executor::Event::Acknowledged* acknowledged = event.mutable_acknowledged(); acknowledged->mutable_task_id()->CopyFrom(evolve(message.task_id())); acknowledged->set_uuid(message.uuid()); return event; }
void statusUpdateAcknowledgement(const StatusUpdate& update, const UPID& pid) { if (aborted) { VLOG(1) << "Not sending status update acknowledgment message because " << "the driver is aborted!"; return; } VLOG(2) << "Sending ACK for status update " << update << " to " << pid; StatusUpdateAcknowledgementMessage message; message.mutable_framework_id()->MergeFrom(framework.id()); message.mutable_slave_id()->MergeFrom(update.slave_id()); message.mutable_task_id()->MergeFrom(update.status().task_id()); message.set_uuid(update.uuid()); send(pid, message); }