wolfier commented on issue #22869: URL: https://github.com/apache/airflow/issues/22869#issuecomment-1093455211
The call to [clearTaskInstances](https://github.com/apache/airflow/blob/2.1.1/airflow/api_connexion/endpoints/task_instance_endpoint.py#L237-L261) will first construct [a query](https://github.com/apache/airflow/blob/2.1.1/airflow/api_connexion/endpoints/task_instance_endpoint.py#L251) that will fetch all task instances that matches the given criteria. With the task instances query, Airflow then [builds a dictionary](https://github.com/apache/airflow/blob/2.1.1/airflow/models/taskinstance.py#L221-L240) where dag id are the keys and a set of execution dates of the task instances are the values. Knowing all of this, when you pass a list with only invalid task ids, it will return query that returns no task instances. No task instances means an empty dictionary. An empty dictionary means no filters will be applied to the dagruns query. No filters means all dagruns will be selected to be set to running. A possible fix would be to check the task instances query result length. An empty result means no dagruns needs to be set to running. -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
