-
Notifications
You must be signed in to change notification settings - Fork 202
Open
Labels
Description
Currently in first_stage()
- the fork parent performs an
exec()to a fresh Python interpreter - the fork child reads the preamble from Mitogen and writes it to the fresh interpreter.
If #1349 is merged then the fork child will also setup a SIGALRM failsafe switch, so that if a deadlock or other failure to read/write the preamble occurs then the processes will terminate. No hung processes should be left behind.
Problem
If the fork child is killed by the SIGALRM, then I expect the Python interpreter to exit with a 0 status. The non-zero exit status of the child will not be propagated, possibly masking this error condition.
Proposal
Switch the parent and child. Now the abnormal process termination may be able to propagate up the process tree to the Mitogen parent that ran it.
Open questions
- Is there a good reason it's not already done this way? Is the current arrangement necessary?
- If the roles are swapped will the exit status actually propagate in common scenarios (local vs ssh)?