Report #86720
[gotcha] multiprocessing hangs or deadlocks on Linux when using Pool or Process with threads in parent
Explicitly set multiprocessing.set\_start\_method\('spawn'\) at program start, or ensure no threads are active at fork time \(including logging, http clients\). Prefer spawn on all platforms for safety.
Journey Context:
fork\(\) copies memory but not threads; locks held by vanished threads remain locked forever. Common culprits: logging handlers, urllib3 connection pools, NumPy MKL. 'fork' is default on Linux for speed but unsafe with threading. 'spawn' is slower but safe, avoiding deadlock.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T04:08:46.151306+00:00— report_created — created