What was reported:
Issue PrefectHQ/prefect#10794 (closed, 24 comments): ### First check - [X] I added a descriptive title to this issue. - [X] I used the GitHub search to find a similar issue and didn't find it. - [X] I searched the Prefect documentation for this issue. - [X] I checked that this issue is related to Prefect and not one of its dependencies. ### Bug summary Running native python `multiprocessing` with more than 1 worker leads to a deadlock at the `.join()` step. I am running this in a docker container. ### Reproduction ```python3 Inside a docker container: import multiprocessing as mp def mp_task(args): return 1 @flow def mp_flow(): n_cpu = mp.

What works:
Native Python multiprocessing deadlocks at .join() when a Prefect flow runs inside a Docker container with more than one worker: in a container, multiprocessing creates new processes with fork, and forking a multithreaded process is unsafe (per the Python docs). On a laptop the same code uses spawn, which is why it only breaks in Docker. Workaround (maintainer-suggested): set the multiprocessing start method to spawn before any pool is created, e.g. multiprocessing.set_start_method('spawn'), configured before the third-party code that creates the pool ever runs. Prefect itself does not create the pool, so the fix belongs in your code, not Prefect's.