mesos-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Benjamin Mahler (JIRA)" <j...@apache.org>
Subject [jira] [Assigned] (MESOS-380) Command Executor doesn't send TASK_KILLED for killed tasks.
Date Sat, 22 Jun 2013 01:33:21 GMT

     [ https://issues.apache.org/jira/browse/MESOS-380?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Benjamin Mahler reassigned MESOS-380:
-------------------------------------

    Assignee: Benjamin Mahler
    
> Command Executor doesn't send TASK_KILLED for killed tasks.
> -----------------------------------------------------------
>
>                 Key: MESOS-380
>                 URL: https://issues.apache.org/jira/browse/MESOS-380
>             Project: Mesos
>          Issue Type: Bug
>            Reporter: Benjamin Mahler
>            Assignee: Benjamin Mahler
>
> Currently the command executor will send either TASK_FAILED or TASK_FINISHED as a result
of a killTask.
> The fix is non-trivial since it requires sharing some state with the waiter thread:
> static void waiter(pid_t pid, const TaskID& taskId, ExecutorDriver* driver)
> {
>   int status;
>   while (wait(&status) != pid || WIFSTOPPED(status));
>   CHECK(WIFEXITED(status) || WIFSIGNALED(status));
>   std::cout << "Waited on process " << pid
>             << ", returned status " << status << std::endl;
>   TaskStatus taskStatus;
>   taskStatus.mutable_task_id()->MergeFrom(taskId);
>   // THIS BIT NEEDS TO KNOW WHETHER THE TASK WAS KILLED!
>   if (WIFEXITED(status) && WEXITSTATUS(status) == 0) {
>     taskStatus.set_state(TASK_FINISHED);
>   } else {
>     taskStatus.set_state(TASK_FAILED);
>   }
>   Try<string> message = WIFEXITED(status)
>     ? strings::format("Command exited with status %d", WEXITSTATUS(status))
>     : strings::format("Command terminated with signal '%s'",
>                       strsignal(WTERMSIG(status)));
>   if (message.isSome()) {
>     taskStatus.set_message(message.get());
>   }
>   driver->sendStatusUpdate(taskStatus);
>   // A hack for now ... but we need to wait until for the status
>   // update to get sent to the slave before we shut ourselves down.
>   sleep(1);
>   driver->stop();
> }

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message