This needs to be tested but Ruff's linting rules and Python's subprocess documentation suggests that using preexec_fn is unsafe and can lead to deadlocks. This may be related to the issue previously experienced with Dask not gracefully shutting down.
The most straightforward fix appears to be using start_new_session=True as an argument, and leaving off preexec_fn. Python 3.11 also supports using a process_group argument.