[ 
https://issues.apache.org/jira/browse/MESOS-7975?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16166547#comment-16166547
 ] 

Alexander Rukletsov edited comment on MESOS-7975 at 9/14/17 5:06 PM:
---------------------------------------------------------------------

This is not 100% bug. It is a philosophical question, whether a task that 
terminates cleanly with zero exit code should be considered killed: we asked 
the task to terminate, but we did not SIGKILL it.

Moreover, we actually changed the behaviour of the docker executor to match the 
behaviour of the command executor. See MESOS-4279 and [this 
review|https://reviews.apache.org/r/48428/], especially, 
[this|https://issues.apache.org/jira/browse/MESOS-4279?focusedCommentId=15249489&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-15249489],
 
[this|https://issues.apache.org/jira/browse/MESOS-4279?focusedCommentId=15096389&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-15096389],
 and 
[this|https://issues.apache.org/jira/browse/MESOS-4279?focusedCommentId=15243232&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-15243232]
 comments.

What message do we want to convey to the scheduler by the status update? The 
framework knows that it initiated the kill, hence the mere fact of receiving a 
terminal status update is a signal that the kill was successful. By using the 
finished update for the task exited with 0 code, we additionally report that 
the task finished cleanly, i.e., not via SIGKILL. Ideally, we should extend the 
reason space for killing and finished status updates and formalize the 
difference between terminal status updates.


was (Author: alexr):
This is not 100% bug. It is a philosophical question, whether a task that 
terminates cleanly with zero exit code should be considered killed: we asked 
the task to terminate, but we did not SIGKILL it.

Moreover, we actually changed the behaviour of the docker executor to match the 
behaviour of the command executor. See MESOS-4279 and [this 
review|https://reviews.apache.org/r/48428/], especially, 
[this|https://issues.apache.org/jira/browse/MESOS-4279?focusedCommentId=15249489&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-15249489],
 
[this|https://issues.apache.org/jira/browse/MESOS-4279?focusedCommentId=15096389&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-15096389],
 and 
[this|https://issues.apache.org/jira/browse/MESOS-4279?focusedCommentId=15243232&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-15243232]
 comments.

> The command/default executor can incorrectly send a TASK_FINISHED update even 
> when the task is killed
> -----------------------------------------------------------------------------------------------------
>
>                 Key: MESOS-7975
>                 URL: https://issues.apache.org/jira/browse/MESOS-7975
>             Project: Mesos
>          Issue Type: Bug
>            Reporter: Anand Mazumdar
>            Assignee: Qian Zhang
>            Priority: Critical
>              Labels: mesosphere
>
> Currently, when a task is killed, the default and the command executor 
> incorrectly send a {{TASK_FINISHED}} status update instead of 
> {{TASK_KILLED}}. This is due to an unfortunate missed conditional check when 
> the task exits with a zero status code.
> {code}
>       if (WSUCCEEDED(status)) {
>         taskState = TASK_FINISHED;
>       } else if (killed) {
>         // Send TASK_KILLED if the task was killed as a result of
>         // kill() or shutdown().
>         taskState = TASK_KILLED;
>       } else {
>         taskState = TASK_FAILED;
>       }
> {code}
> We should modify the code to correctly send {{TASK_KILLED}} status updates 
> when a task is killed.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to