Neil Conway created MESOS-6333:
----------------------------------

             Summary: Don't send TASK_LOST when removing a framework from an 
agent
                 Key: MESOS-6333
                 URL: https://issues.apache.org/jira/browse/MESOS-6333
             Project: Mesos
          Issue Type: Improvement
          Components: master
            Reporter: Neil Conway
            Assignee: Neil Conway


Update this code:

{code}
  // Remove pointers to framework's tasks in slaves, and send status
  // updates.
  // NOTE: A copy is needed because removeTask modifies slave->tasks.
  foreachvalue (Task* task, utils::copy(slave->tasks[framework->id()])) {
    // Remove tasks that belong to this framework.
    if (task->framework_id() == framework->id()) {
      // A framework might not actually exist because the master failed
      // over and the framework hasn't reconnected yet. For more info
      // please see the comments in 'removeFramework(Framework*)'.
      const StatusUpdate& update = protobuf::createStatusUpdate(
        task->framework_id(),
        task->slave_id(),
        task->task_id(),
        TASK_LOST,
        TaskStatus::SOURCE_MASTER,
        None(),
        "Slave " + slave->info.hostname() + " disconnected",
        TaskStatus::REASON_SLAVE_DISCONNECTED,
        (task->has_executor_id()
            ? Option<ExecutorID>(task->executor_id()) : None()));

      updateTask(task, update);
      removeTask(task);
      forward(update, UPID(), framework);
    }
  }
{code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to