mjohansenwork opened a new issue, #41140:
URL: https://github.com/apache/airflow/issues/41140

   ### Apache Airflow version
   
   2.9.3
   
   ### If "Other Airflow 2 version" selected, which one?
   
   _No response_
   
   ### What happened?
   
   For `ExternalTaskSensor`, when I specify `deferrable=True` and 
`failed_states=["failed"]`, the operator hangs in deferred mode and repeatedly 
pokes the upstream DAG status. This works fine if I don't use deferrable.
   
   ### What you think should happen instead?
   
   I would expect this to fail immediately if the upstream DAG status is failed.
   
   ### How to reproduce
   
   Create 2 DAGs, upstream and downstream. Make the upstream DAG fail 
intentionally. Make the downstream DAG depend on the upstream DAG using 
`ExternalTaskSensor`, setting `deferrable=True` and `failed_states=["failed"]`. 
Observe that the downstream `ExternalTaskSensor` loops and pokes continuously, 
even though the upstream DAG has failed.
   
   ### Operating System
   
   MacOS
   
   ### Versions of Apache Airflow Providers
   
   _No response_
   
   ### Deployment
   
   Other Docker-based deployment
   
   ### Deployment details
   
   I'm using the Astronomer runtime `11.7.0` docker image.
   
   ### Anything else?
   
   I noticed that in deferrable mode, the `failed_states` don't appear to be 
forwarded to the `WorkflowTrigger` 
[here](https://github.com/apache/airflow/blob/main/airflow/sensors/external_task.py#L357),
 which seems like a bug.
   Possibly related:
   https://github.com/apache/airflow/issues/16204 and 
https://github.com/apache/airflow/pull/27190 
https://github.com/apache/airflow/issues/34207 and 
https://github.com/apache/airflow/issues/34204
   
   ### 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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to