airflow icon indicating copy to clipboard operation
airflow copied to clipboard

An asset watcher that fails after firing an event is restarted with no failure recorded

Open seanghaeli opened this issue 3 weeks ago • 1 comments

When a trigger raises after it has fired at least one event, cleanup_finished_triggers (airflow-core/src/airflow/jobs/triggerer_job_runner.py) only logs the exception: it reports a failure only when the trigger fired nothing (if details["events"] == 0). For a deferred task that's fine, since the event already resumed it. But an asset watcher is re-created right away, and its row's failure count, status and last error never change, so a watcher that fires once and then crashes every time looks healthy in the API and UI.

Done when: a watcher that raises after firing an event is recorded as a failure (Trigger.submit_failure), the same way as one that raises before, while a deferred task's trigger still isn't, with a test for both cases.

This is small and self-contained, so it would make a good first issue.

seanghaeli avatar Nov 13 '26 18:11 seanghaeli

Implemented in PR #77745. The triggerer now records an asset watcher failure even when the watcher emitted an event before raising, while deferred-task triggers retain their existing behavior. Added regression coverage for both paths.

senapati484 avatar Nov 29 '26 14:11 senapati484