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

   ### Apache Airflow version
   
   Other Airflow 2 version (please specify below)
   
   ### If "Other Airflow 2 version" selected, which one?
   
   2.7.1
   
   ### What happened?
   
   on_failure_callback is not called when task is terminated externally.
   A similar issue was reported in 
https://github.com/apache/airflow/issues/25297 and fixed in 
https://github.com/apache/airflow/pull/29743.
   I saw that the code change to call the on_failure_callback in this cases is 
no longer present on [version 
2.7.1](https://github.com/apache/airflow/blob/2.7.1/airflow/models/taskinstance.py#L1620).
   After which on_failure_callback is no longer called when SIGTERM is received
   
   As you can see from the screenshots bellow the function was never called, 
the logs are never printed.
   
![image](https://github.com/apache/airflow/assets/68713515/22126d1a-2b71-4716-a4b1-cef6cf473a80)
   
![image](https://github.com/apache/airflow/assets/68713515/e07c4ba3-76f4-4b23-a647-a921fa249f28)
   
![image](https://github.com/apache/airflow/assets/68713515/66a3122d-1804-48cd-bda7-752353df21cc)
   
![image](https://github.com/apache/airflow/assets/68713515/2a92a25a-6ac0-4fba-8675-61912ab9fa4e)
   
   
   ### What you think should happen instead?
   
   on_failure_callback should be called when task fails including when the task 
was manually marked as failed.
   
   ### How to reproduce
   
   Create a dag task with an on_failure_callback configured, start and then 
mark the task as failed. You can see from the log that the function was never 
called.
   
   ### Operating System
   
   debian
   
   ### Versions of Apache Airflow Providers
   
   _No response_
   
   ### Deployment
   
   Other Docker-based deployment
   
   ### Deployment details
   
   _No response_
   
   ### Anything else?
   
   _No response_
   
   ### Are you willing to submit PR?
   
   - [ ] 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