In python, I have a parent process that spawns multiple child processes. I was faced with a situation where, due to an unhandled exception, the parent process was dying, and the child process was processed where it remained an orphan. How to make child processes recognize that they have lost a parent?
I tried code that hooks the child process to every available signal, and none of them were running. I could theoretically put in a giant attempt / exclusion from the parent process to ensure that it at least calls the sigster for the children, but it is inelegant and not flawless. How to prevent orphan processes?
source share