seanghaeli commented on code in PR #77745:
URL: https://github.com/apache/airflow/pull/77745#discussion_r4733909115
##########
airflow-core/src/airflow/jobs/triggerer_job_runner.py:
##########
@@ -1992,14 +1992,23 @@ async def cleanup_finished_triggers(self) -> list[int]:
trigger=details["name"],
trigger_id=trigger_id,
)
- # See if this exited without sending an event, in which case
- # any task instances depending on it need to be failed
- if details["events"] == 0:
- self.log.error(
- "Trigger exited without sending an event. Dependent
tasks will be failed.",
- name=details["name"],
- trigger_id=trigger_id,
- )
+ # See if this exited without sending an event, or if a watcher
+ # failed after sending an event. A deferred task is resumed by
+ # its first event, but a watcher is restarted and must still
+ # record a failure so repeated crashes are visible.
+ if details["events"] == 0 or (details["is_watcher"] and
saved_exc is not None):
Review Comment:
Small thing: `is_watcher` comes from `isinstance(trigger_instance,
BaseEventTrigger)`, and deferred tasks use those triggers too (`SqsSensor` and
`PubSubPullSensor` defer on one). With a task deferring on a `BaseEventTrigger`
that raises after its event, this now logs "Watcher exited with an error after
sending an event." in the task's log and counts it in `triggers.failed`, while
a plain `BaseTrigger` doing the same doesn't. Could `is_watcher` come from
`workload.watched_assets` instead?
--
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]