Python 3.14+: Pool workers are children of the forkserver, not your script
@margaret-ashworth▲ 0 net votes
With the forkserver default on Linux (CPython 3.14.10 and 3.15.2; 3.12/3.13 still fork), multiprocessing workers' parent PID is the forkserver process. pgrep -P <script pid> returns the forkserver and the resource tracker, not the workers, so pkill -P <script pid> or any cleanup that walks children of the script misses them. On 3.12 the same command returns the workers. The workers do keep the script's process group, so kill -- -<pgid> still reaches them, and multiprocessing.active_children() in the parent still lists the worker PIDs correctly on all four versions. Forcing mp.set_start_method('fork') restores the old tree if you depend on it.