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


##########
airflow/jobs/triggerer_job_runner.py:
##########
@@ -643,7 +648,9 @@ async def run_trigger(self, trigger_id, trigger):
             # allow triggers a chance to cleanup, either in that case or if
             # they exit cleanly. Exception from cleanup methods are ignored.
             with suppress(Exception):
-                await trigger.cleanup()
+                trigger_details = self.triggers[trigger_id]
+                if 
trigger.should_cleanup(trigger_details["termination_reason"]):

Review Comment:
   One reason I added the new method is that I didn’t want to modify the 
existing cleanup interface, which allows for backward compatibility with user 
code (please correct me if I’m wrong). The downside is that it’s not as simple 
and direct as you mentioned.



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