uranusjr commented on code in PR #41232:
URL: https://github.com/apache/airflow/pull/41232#discussion_r1716328140


##########
airflow/jobs/triggerer_job_runner.py:
##########
@@ -538,10 +539,13 @@ async def cancel_triggers(self):
         This allows the cleanup job to delete them.
         """
         while self.to_cancel:
-            trigger_id = self.to_cancel.popleft()
+            trigger_id, reason = self.to_cancel.popleft()
             if trigger_id in self.triggers:
+                # Add more context here before cancelling
+                to_be_cancelled = self.triggers[trigger_id]
+                to_be_cancelled["termination_reason"] = reason
                 # We only delete if it did not exit already
-                self.triggers[trigger_id]["task"].cancel()
+                to_be_cancelled["task"].cancel()

Review Comment:
   I couldn’t find where this `to_be_cancelled` is used. Why do we store things 
into this dict that’s never read by anyone?



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