funes79 opened a new issue, #31180: URL: https://github.com/apache/airflow/issues/31180
### Apache Airflow version 2.6.0 ### What happened I created a plugin for custom listeners, the task level listeners works fine, but the dag level listeners are not triggered. The [docs](https://airflow.apache.org/docs/apache-airflow/stable/administration-and-deployment/listeners.html) states that listeners defined in `airflow/listeners/spec` should be supported. ``` @hookimpl def on_task_instance_failed(previous_state: TaskInstanceState, task_instance: TaskInstance, session): """ This method is called when task state changes to FAILED. Through callback, parameters like previous_task_state, task_instance object can be accessed. This will give more information about current task_instance that has failed its dag_run, task and dag information. """ print("This works fine") @hookimpl def on_dag_run_failed(dag_run: DagRun, msg: str): """ This method is called when dag run state changes to FAILED. """ print("This is not called!") ``` ### What you think should happen instead The dag specs defined `airflow/listeners/spec/dagrun.py` should be working ### How to reproduce Create a plugin and add the two hooks into a listeners. ### Operating System linux ### Versions of Apache Airflow Providers _No response_ ### 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]
