SakshamKapoor2911 commented on code in PR #67881:
URL: https://github.com/apache/airflow/pull/67881#discussion_r3486205990
##########
airflow-core/src/airflow/executors/local_executor.py:
##########
@@ -258,19 +261,40 @@ def end(self) -> None:
if proc.is_alive():
self.activity_queue.put(None)
- for proc in self.workers.values():
- if proc.is_alive():
- proc.join()
- proc.close()
+ # To prevent deadlock, we should consume results from result_queue
while waiting for processes to join.
+ # Otherwise, a worker blocked on putting results into a full
result_queue pipe will never exit,
+ # and an unbounded proc.join() will hang the scheduler indefinitely.
+ try:
+ for proc in self.workers.values():
+ if proc.is_alive():
+ while proc.is_alive():
Review Comment:
I've removed the redundant outer `is_alive()` check. The join loop now
relies on the single `while proc.is_alive()` condition while continuing to
drain `_read_results()` between timed joins.
--
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]