Skip to content

Commit ceb3b2a

Browse files
authored
Avoid zombie processes when parallel builds fail (sphinx-doc#11923)
1 parent 9faf114 commit ceb3b2a

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

sphinx/util/parallel.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,12 @@ def add_task(
9494
proc = context.Process(target=self._process, args=(psend, task_func, arg))
9595
self._procs[tid] = proc
9696
self._precvsWaiting[tid] = precv
97-
self._join_one()
97+
try:
98+
self._join_one()
99+
except Exception:
100+
# shutdown other child processes on failure
101+
# (e.g. OSError: Failed to allocate memory)
102+
self.terminate()
98103

99104
def join(self) -> None:
100105
try:

0 commit comments

Comments
 (0)