andrewgodwin commented on a change in pull request #15389:
URL: https://github.com/apache/airflow/pull/15389#discussion_r638347552
##########
File path: airflow/jobs/scheduler_job.py
##########
@@ -1899,3 +1910,17 @@ def adopt_or_reset_orphaned_tasks(self, session: Session
= None):
raise
return len(to_reset)
+
+ @provide_session
+ def check_trigger_timeouts(self, session: Session = None):
+ """
+ Looks at all tasks that are in the "deferred" state and whose trigger
+ timeout has passed, so they can be marked as failed.
+ """
+ timed_out_tasks = session.query(TaskInstance).filter(
+ TaskInstance.state == State.DEFERRED, TaskInstance.trigger_timeout
< timezone.utcnow()
+ )
+ num_tasks = timed_out_tasks.count()
Review comment:
What do you mean by `func.count`? Do you mean limiting the count query
to only be over a single column or something?
--
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.
For queries about this service, please contact Infrastructure at:
[email protected]