When a parent process spawns a multiprocessing workforce and then violently crashes, some worker processes may survive and not be cleaned up. This results in unnecessary memory and process bloating.
We could add a monitoring thread for each worker that periodically checks if the parent process has died, and if so, self-destruct.
When a parent process spawns a
multiprocessingworkforce and then violently crashes, some worker processes may survive and not be cleaned up. This results in unnecessary memory and process bloating.We could add a monitoring thread for each worker that periodically checks if the parent process has died, and if so, self-destruct.