dstandish commented on code in PR #31757:
URL: https://github.com/apache/airflow/pull/31757#discussion_r1228503159


##########
airflow/jobs/triggerer_job_runner.py:
##########
@@ -608,6 +609,14 @@ async def run_trigger(self, trigger_id, trigger):
                 self.log.info("Trigger %s fired: %s", 
self.triggers[trigger_id]["name"], event)
                 self.triggers[trigger_id]["events"] += 1
                 self.events.append((trigger_id, event))
+
+            trigger_timeout = trigger.task_instance.trigger_timeout
+            if trigger_timeout and trigger_timeout < timezone.utcnow():
+                self.log.info("Trigger cancelled due to timeout")
+                raise asyncio.CancelledError("Trigger cancelled due to 
timeout")

Review Comment:
   i think this needs to be moved inside the `except asyncio.CancelledError as 
err` block; i don't think it will be reached otherwise.
   
   otherwise, looks good. good idea checking the time.  it may not be the most 
"direct" way but it's a lot nicer from implementation perspective than trying 
to send the "why" information to the database (since the timeout decision is 
actually made by the scheduler) and read that in the triggerer.



-- 
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]

Reply via email to