1

When using the newest Airflow version (2.4.2), the on_failure_callback doesnt get triggered on KubernetesPodOperator tasks. The on_success_callback works just fine.

For each KubernetesPodOperator task I set on_success_callback=send_success_notification() and on_failure_callback=send_failure_notification().

If the task succeeds, the notification gets send. However, in case of failure, the on_failure_callback doesn't get triggered. Is this some bug related to newest version?

mato777
  • 11
  • 1
  • To help you debug, can you post your complete log upon a DAG run which fails? It should normally show that the failure callback function was called. Can you post that along with your send_failure_notification() function? As an initial step to debug, can you log something at very beginning of your send_failure_notification function and see if you can see it? – Diana Vazquez Romo Nov 28 '22 at 17:06
  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. – Community Nov 29 '22 at 03:11

1 Answers1

0

I know it's a late answer but there's a mistake or typo in the examples:

... I set on_success_callback=send_success_notification() and on_failure_callback=send_failure_notification().

Both the send_success_notification() and send_failure_notification() should be a reference to the function, not a function call. What I mean is you need to drop the brackets () from the end like:

on_success_callback=send_success_notification and on_failure_callback=send_failure_notification

Gergely M
  • 583
  • 4
  • 11