ido177 opened a new issue, #56942: URL: https://github.com/apache/airflow/issues/56942
### Apache Airflow version 3.1.0 ### If "Other Airflow 2/3 version" selected, which one? _No response_ ### What happened? We’ve encountered unexpected behavior with `on_failure_callback`. When a task fails and Airflow components(such as a worker or API server) are restarted before the state is fully processed, the task transitions to `up_for_retry`. However, even though the task is not in a final `failed` state, the `on_failure_callback` is still triggered. This results in false alerts - in our case, Slack notifications indicating that a task has failed, while in fact it is just being retried. ### What you think should happen instead? `on_failure_callback` should only be called when the task ends in a final failed state, not when it’s going to be retried ### How to reproduce 1. Create a DAG with a task that has retries > 0 and an on_failure_callback defined. 2. Before the task finish, restart the Airflow worker or API server. 3. Observe that the task transitions to up_for_retry, but the on_failure_callback is still executed. ### Operating System Debian ### Versions of Apache Airflow Providers apache-airflow==3.1.0 apache-airflow-providers-google==18.0.0 apache-airflow-providers-mysql==6.3.4 apache-airflow-providers-slack==9.3.0 apache-airflow-providers-vertica==4.1.2 apache-airflow-providers-apache-livy==4.4.3 apache-airflow-providers-ssh==4.1.4 apache-airflow-providers-common-sql==1.28.1 apache-airflow-providers-cncf-kubernetes==10.8.2 apache-airflow-providers-hashicorp==4.3.2 apache-airflow-providers-standard==1.9.0 apache-airflow-providers-postgres==6.3.0 apache-airflow-providers-apache-cassandra==3.8.2 apache-airflow-providers-fab==3.0.0 apache-airflow-providers-amazon==9.15.0 ### Deployment Official Apache Airflow Helm Chart ### 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]
