ManiBharataraju commented on issue #26760:
URL: https://github.com/apache/airflow/issues/26760#issuecomment-2100315988

   > Hey @vgupta3! Have you tried applying your `on_failure_callback` to 
`default_args` instead? Setting [`on_failure_callback` at the DAG 
level](https://airflow.apache.org/docs/apache-airflow/stable/_api/airflow/models/dag/index.html#airflow.models.dag.DAG)
 applies to the DagRun failing not tasks specifically.
   > 
   > > on_failure_callback (DagStateChangeCallback | None) – A function to be 
called when a DagRun of this dag fails. A context dictionary is passed as a 
single parameter to this function.
   
   @josh-fell - This doesn't appear to be happening. I have 
`on_failure_callback` set in `default_args` but it gets fired as soon as the 
task fails while the DAG is still in running state. I have also encountered 
instances where it fired twice for a failed DAG, one for the DAG(where the task 
name was wrong) and other for the task that actually failed. So I am assuming 
there is some issue the way callbacks are handled.


-- 
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