ephraimbuddy commented on code in PR #74794:
URL: https://github.com/apache/airflow/pull/74794#discussion_r4536137311
##########
airflow-core/src/airflow/dag_processing/manager.py:
##########
@@ -2716,10 +2853,15 @@ def terminate(self):
processor.kill(signal.SIGTERM, escalation_delay=5.0)
def end(self):
- """Kill all child processes on exit since we don't want to leave them
as orphaned."""
+ """Kill child processes so none are orphaned, then acknowledge work
that already finished."""
pids_to_kill = [p.pid for p in self._processors.values()]
if pids_to_kill:
kill_child_processes_by_pids(pids_to_kill)
+ # Claims the server releases after this Job ends are delivered again,
repeating their callbacks.
+ try:
+ self.work_source.flush(deadline=math.inf)
+ except Exception:
+ self.log.exception("Unable to acknowledge requested work before
exiting")
Review Comment:
Retired registrations now produce a warning without a traceback during
shutdown. Unexpected errors still retain their traceback. The test checks both
paths; mutation testing confirmed that replacing `log.exception` with
`log.error` fails the traceback assertion.
---
Drafted-by: Codex (GPT-6); reviewed by @ephraimbuddy before posting
--
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]