wolfier opened a new issue #18304: URL: https://github.com/apache/airflow/issues/18304
### Apache Airflow version main (development) ### Operating System Debian GNU/Linux 10 (buster) ### Versions of Apache Airflow Providers _No response_ ### Deployment Astronomer ### Deployment details Barebones deployment with one DAG. ### What happened I have a DAG with the following attribute: - `depend_on_past` set as true - `max_active_runs` set as one - `catchup` set as true When my task failed, which then followed by my dagrun failing, Airflow moved on to execute the next dagrun. The current dagrun it is working stopped because of the previous instance of the task instance failed. Instinctively, I cleared the failed task and the dagrun went back into queued. This is where the deadlock happens, the current dagrun will not move because of the previous dagrun and the previous dagrun is in the queued state waiting for available active dagrun slots. ![image](https://user-images.githubusercontent.com/5952735/133678178-3fa8d5da-2201-4102-99d0-88d17a4a2fd7.png) ### What you expected to happen _No response_ ### How to reproduce Imagine a DAG with these tasks and dependencies. A -> B -> C. The DAG has two dagruns 1 and 2 that are consecutive of each other where 1 is before 2 in execution date. 1. Task B of dagrun 1 fails so dagrun 1 fails. 2. Dagrun 2 goes into running state 3. Task A of dagrun 2 succeeds but scheduler cannot queue Task B of dagrun 2 because the past instance of Task B is not in the successful state. 4. User clears Task B of dagrun 1 but dagrun 1 cannot go into the running state since the limit of maximum active runs is reached with dagrun 2 is in the running state. ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md) -- 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. To unsubscribe, e-mail: commits-unsubscr...@airflow.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org