Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WIP: Forward parent death to descendant processes
If the uds_fd connection to the parent BEAM is broken or closed, react by killing all children and any descendants in the same process group. Changing from _exit to exit is significant. This patch installs an atexit handler, which wouldn't be executed when using the _exit variant. It's unclear why the "immediate" variant was being used until now, it would make sense if there were a danger of eg. memory corruption which would cause segfaults on freeing, but many of these were only being used on wire protocol errors. To start a child process which can outlive BEAM termination, give it a new process group for example by using `setsid`: erl -noshell -eval 'os:cmd("setsid sleep 60")' FIXME: Killing child processes may be a breaking change for any code which assumed that the child process will outlive the VM. Is this fixing a bug, or causing one? If the default should remain unchanged we can add an optional flag such as `kill_group` to open_port making this behavior switchable per child. TODO: Needs docs and tests.
- Loading branch information