Skip to content

Commit

Permalink
Avoid zombie processes when parallel builds fail (#11923)
Browse files Browse the repository at this point in the history
  • Loading branch information
felixvd committed Feb 3, 2024
1 parent 9faf114 commit ceb3b2a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion sphinx/util/parallel.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,12 @@ def add_task(
proc = context.Process(target=self._process, args=(psend, task_func, arg))
self._procs[tid] = proc
self._precvsWaiting[tid] = precv
self._join_one()
try:
self._join_one()
except Exception:
# shutdown other child processes on failure
# (e.g. OSError: Failed to allocate memory)
self.terminate()

def join(self) -> None:
try:
Expand Down

0 comments on commit ceb3b2a

Please sign in to comment.