potiuk commented on code in PR #68792:
URL: https://github.com/apache/airflow/pull/68792#discussion_r3887151521
##########
airflow-core/src/airflow/jobs/triggerer_job_runner.py:
##########
@@ -332,6 +332,8 @@ class TriggerStateChanges(BaseModel):
# Format of list[str] is the exc traceback format
failures: list[tuple[int, list[str] | None]] | None = None
finished: list[int] | None = None
+ # Ids the runner has a live coroutine for
+ running_ids: set[int] = set()
Review Comment:
An empty set means "the runner has no live coroutines", which is
indistinguishable from "this message carried no `running_ids` at all". In the
second case `unhandled = self.running_triggers - set()` is everything, so the
supervisor drops and re-creates every running trigger.
No production path hits this today — `process_trigger_events` and
`sanitize_trigger_events` both set the field. But the existing tests construct
the message without it (e.g. `TriggerStateChanges(events=None, failures=None,
finished=None)` in `test_triggerer_job.py`), which is exactly that shape. With
this carrying `backport-to-v3-3-test`, I would rather the ambiguity not exist
at all:
```suggestion
# Ids the runner has a live coroutine for; None when the message
carries no information
running_ids: set[int] | None = None
```
with an early return in `check_for_unhandled_triggers` when `running_ids is
None`.
---
Drafted-by: Claude Code (Opus 5); reviewed by @potiuk before posting
--
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]