rajasaur opened a new issue #8570: URL: https://github.com/apache/airflow/issues/8570
<!-- Welcome to Apache Airflow! For a smooth issue process, try to answer the following questions. Don't worry if they're not all applicable; just try to include what you can :-) If you need to include code snippets or logs, please put them in fenced code blocks. If they're super-long, please use the details tag like <details><summary>super-long log</summary> lots of stuff </details> Please delete these comment blocks before submitting the issue. --> <!-- IMPORTANT!!! PLEASE CHECK "SIMILAR TO X EXISTING ISSUES" OPTION IF VISIBLE NEXT TO "SUBMIT NEW ISSUE" BUTTON!!! PLEASE CHECK IF THIS ISSUE HAS BEEN REPORTED PREVIOUSLY USING SEARCH!!! Please complete the next sections or the issue will be closed. This questions are the first thing we need to know to understand the context. --> **Apache Airflow version**: 1.10.10 **Kubernetes version (if you are using kubernetes)** (use `kubectl version`): No K8s **Environment**: Mac OSX , Python 2.7 with Postgres( running on Docker) **What happened**: It looks like if u try to cancel a task that is in the "up_for_reschedule" state, that task doesnt get canceled. The DAG Run itself gets canceled but not any of the tasks if the current task is in the reschedule state. **What you expected to happen**: The task should also be "Failed" along with that Run instance **How to reproduce it**: Create a dag with a task that reschedule's it after some time. Meanwhile try to mark that dag run as 'Failed'. The run changes as failed, but the tasks are still left as is. **Anything else we need to know**: Looking through the source, `set_dag_run_state_to_failed` only seems to mark tasks as FAILED that are running. If I have a task that has been rescheduled to run at a future time and I try to mark that as FAILED, it doesnt seem to do that as the code seems to only filter tasks that have `state == State.RUNNING` ` tis = session.query(TaskInstance).filter( TaskInstance.dag_id == dag.dag_id, TaskInstance.execution_date == execution_date, TaskInstance.task_id.in_(task_ids)).filter(TaskInstance.state == State.RUNNING) ` I can get a PR to include both the states , if this seems okay. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org