@@ -2497,6 +2497,11 @@ def _run_parallel_rolling(
24972497 a ``stop.txt`` sentinel was detected.
24982498 """
24992499 from concurrent .futures import wait as _fut_wait , FIRST_COMPLETED
2500+ try :
2501+ from concurrent .futures .process import BrokenProcessPool as _BrokenProcessPool
2502+ except ImportError :
2503+ # Fallback: catch all submit-time errors as pool-broken
2504+ _BrokenProcessPool = RuntimeError # type: ignore[misc,assignment]
25002505
25012506 executor = ProcessPoolExecutor (
25022507 max_workers = self .n_parallel ,
@@ -2587,7 +2592,7 @@ def _try_submit() -> bool:
25872592
25882593 try :
25892594 future = executor .submit (_autots_worker , config , run_dir , workspace )
2590- except BrokenProcessPool as exc :
2595+ except _BrokenProcessPool as exc :
25912596 # The pool died between the last result and this submit.
25922597 # Release the task so it can be retried on resume, then
25932598 # stop submitting — remaining in-flight futures will drain
@@ -2705,7 +2710,7 @@ def _handle_done(future) -> None:
27052710 if not exhausted and not _should_stop ():
27062711 try :
27072712 _try_submit ()
2708- except BrokenProcessPool as exc :
2713+ except _BrokenProcessPool as exc :
27092714 # Defensive catch: _try_submit normally handles this
27102715 # internally, but guard here too so the drain loop
27112716 # can finish processing remaining futures safely.
0 commit comments