Rishabjain999 opened a new pull request, #69991:
URL: https://github.com/apache/airflow/pull/69991
`_send_dag_callbacks_to_processor` was called unconditionally for every
Dag run in every scheduler loop, passing `None` when the run had no
callback defined. This caused two problems:
1. A spurious `"callback is empty"` debug log fired on every scheduling
iteration for every run that was still in progress or had no
callbacks defined. Users enabling `DEBUG` logging misread this as
evidence that Dag-level `on_failure_callback` was silently dropped
(reported in #63374).
2. An unnecessary `cached_get_dag` lookup was performed for runs that
will never produce a callback.
**Fix:** Guard the dispatch on `callback_to_run` being non-`None` so
the method is only called when there is actually a callback to send.
Remove the unused `dag` parameter and the misleading `else` branch from
the method itself, since all call sites now guarantee a non-`None`
callback before calling it.
**Tests updated:**
- `test_dagrun_callbacks_are_not_added_when_callbacks_are_not_defined`:
changed from asserting the method was called with `None` to asserting
it was never called.
- `test_dagrun_callbacks_are_added_when_callbacks_are_defined`: updated
comment to correctly describe what is being verified.
closes: #63374
--
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]