JH0917 commented on code in PR #68792:
URL: https://github.com/apache/airflow/pull/68792#discussion_r4573217918
##########
airflow-core/src/airflow/jobs/triggerer_job_runner.py:
##########
@@ -933,6 +937,24 @@ def clean_unused(self) -> None:
with attempt, create_session() as session:
Trigger.clean_unused(session=session)
+ def check_for_unhandled_triggers(self, running_ids: set[int] | None) ->
None:
+ """
+ Re-create triggers we track as running that the runner has no
coroutine for.
+
+ Only valid between finished-removal and to_create-addition in
``_handle_request``, where the
+ two sides agree. Dropping the leftovers lets :meth:`update_triggers`
rebuild them.
+ """
+ if running_ids is None:
+ return
+ unhandled = self.running_triggers - running_ids
+ if not unhandled:
+ return
+ log.error("Triggers have no coroutine in the runner; re-creating",
trigger_ids=sorted(unhandled))
+ self.running_triggers -= unhandled
Review Comment:
Thanks, I added it as you suggested. close() can raise too, so the helper
catches that as well. That also changes the finished path.
--
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]