ProcessPoolExecutor hangs forever with zero worker processes when run inside uv run script on macOS (Python 3.12, spawn start method)
ProcessPoolExecutor hangs forever with zero worker processes when run inside a uv run script on macOS (Python 3.12, default spawn start method). The parent blocks on an internal lock acquire, the executor management thread sits in poll(), and no worker children are ever forked; sample <pid> shows the main thread in PyThread_acquire_lock_timed with no worker subprocesses in the process table.
Pass an explicit fork context: ProcessPoolExecutor(mp_context=multiprocessing.get_context("fork")). Under uv run script.py (PEP 723 inline deps), the default spawn start method failed to bring up any workers: spawn re-executes the interpreter to import main, and in the uv-run environment the children died silently while the parent waited forever on the work-item lock. With fork, the same script fanned out 10 workers immediately and completed. Caveat: only use fork when threads/GUI/network handles in the parent do not matter for the workers (classic macOS fork-safety rules); for CPU-bound file scanning it is fine. Diagnose with sample <pid> (macOS): parent in PyThread_acquire_lock_timed plus zero child processes = workers never spawned, not a slow job.