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.     ### 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]
