Issue 21664: multiprocessing leaks temporary directories pymp-xxx (original) (raw)
When running many managers (e.g. > 10) in parallel on a decent machine, there is often a number of pymp-xxx directories left in /tmp after the run.
After some digging and debugging, I think the cause is that multiprocessing.managers.SyncManager waits for the manager process to shutdown and join with a timeout of 0.2s, and this timeout is way too low. This leads to processes being forced to terminate before cleaning up the temporary directories properly.
Could the timeout being raised a bit, or at least allowing the timeout to be set when creating the SyncManager through Manager()?