mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Fix #8952: Exceptions raised in a Directive cause parallel builds to hang
Do shutdown explicitly when failure on the subprocess.
This commit is contained in:
parent
99d97c65d5
commit
ec6ab7243d
2
CHANGES
2
CHANGES
@ -16,6 +16,8 @@ Features added
|
||||
Bugs fixed
|
||||
----------
|
||||
|
||||
* #8952: Exceptions raised in a Directive cause parallel builds to hang
|
||||
|
||||
Testing
|
||||
--------
|
||||
|
||||
|
@ -103,8 +103,21 @@ class ParallelTasks:
|
||||
self._join_one()
|
||||
|
||||
def join(self) -> None:
|
||||
while self._pworking:
|
||||
self._join_one()
|
||||
try:
|
||||
while self._pworking:
|
||||
self._join_one()
|
||||
except Exception:
|
||||
# shutdown other child processes on failure
|
||||
self.terminate()
|
||||
raise
|
||||
|
||||
def terminate(self) -> None:
|
||||
for tid in list(self._precvs):
|
||||
self._procs[tid].terminate()
|
||||
self._result_funcs.pop(tid)
|
||||
self._procs.pop(tid)
|
||||
self._precvs.pop(tid)
|
||||
self._pworking -= 1
|
||||
|
||||
def _join_one(self) -> None:
|
||||
for tid, pipe in self._precvs.items():
|
||||
|
Loading…
Reference in New Issue
Block a user