[ https://issues.apache.org/jira/browse/MESOS-7975?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16167234#comment-16167234 ]
Qian Zhang edited comment on MESOS-7975 at 9/15/17 2:37 AM: ------------------------------------------------------------ I think it depends on how we define the meaning of {{TASK_FINISHED}}, if it means the task is terminated successfully *on its own without external interference* (as Anand said), then I think it does not make sense for scheduler to receive a {{TASK_KILLING}} followed by a {{TASK_FINISHED}} since there is indeed an external interference (killing task is initiated by scheduler). However, if {{TASK_FINISHED}} means the task is terminated successfully for whatever reason (no matter it is killed or terminated on its own), then I think it is OK to receive a {{TASK_KILLING}} followed by a {{TASK_FINISHED}}. was (Author: qianzhang): I think it depends on how we define the meaning of {{TASK_FINISHED}}, if it means the task is terminated successfully *on its own without external interference* (as Anand said), then I think it does not make sense for scheduler to receive a {{TASK_KILLING}} followed by a {{TASK_FINISHED}} since there is indeed an external interference (killing task is initiated by scheduler). However, if {{TASK_FINISHED}} means the task is terminated successfully for whatever reason, then I think it is OK to receive a {{TASK_KILLING}} followed by a {{TASK_FINISHED}}. > 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)