[ https://issues.apache.org/jira/browse/FLINK-17726?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17124808#comment-17124808 ]
Till Rohrmann commented on FLINK-17726: --------------------------------------- Sorry for my late reply. I think we should handle all state transition to {{CANCELED}} from a different state than {{CANCELLING}} on the {{JobMaster}} as a failure. This effectively means that the {{JobMaster}} must initiate the cancellation in one form or another. If we wanted the {{Task}} to be smart and to initiate the cancellation, then it would have to be sure that there is another {{Task}} which reported a failure back to the {{JobMaster}}. I think in the general case this is very hard to guarantee (only if the other task sends a message that it successfully transmitted this state transition to the {{JobMaster}} it would be ok). Consequently, if there is the situation of {{A1 -> B1}} and {{A1}} fails and {{B1}} realizes it, then {{B1}} cannot be sure that {{A1}} could update the {{JM}} and has to fail. Only if the {{JM}} sent the cancellation request it knows that the failure of {{A1}} has been successfully reported and it can cancel. One way to ensure this contract on the {{Task}} side could be to only allow state transition from {{CANCELLING}} to {{CANCELED}}. Concretely, this means that we transition into {{FAILED}} if we see a {{CancelTaskException}} if the current {{Task}} state is not {{CANCELLING}}. Does this make sense? > Scheduler should take care of tasks directly canceled by TaskManager > -------------------------------------------------------------------- > > Key: FLINK-17726 > URL: https://issues.apache.org/jira/browse/FLINK-17726 > Project: Flink > Issue Type: Bug > Components: Runtime / Coordination, Runtime / Task > Affects Versions: 1.11.0, 1.12.0 > Reporter: Zhu Zhu > Assignee: Nicholas Jiang > Priority: Critical > Fix For: 1.11.0, 1.12.0 > > > JobManager will not trigger failure handling when receiving CANCELED task > update. > This is because CANCELED tasks are usually caused by another FAILED task. > These CANCELED tasks will be restarted by the failover process triggered > FAILED task. > However, if a task is directly CANCELED by TaskManager due to its own runtime > issue, the task will not be recovered by JM and thus the job would hang. > This is a potential issue and we should avoid it. > A possible solution is to let JobManager treat tasks transitioning to > CANCELED from all states except from CANCELING as failed tasks. -- This message was sent by Atlassian Jira (v8.3.4#803005)