Commit 80f301a
committed
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.
A concise demonstration of the problem being solved is to run this
command with and without the patch, then kill the BEAM. Without the
patch, the "sleep" process will continue:
erl -noshell -eval 'os:cmd("sleep 60")'
To intentionally 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")'
TODO: Needs to be tested on win321 parent 99b7bde commit 80f301a
File tree
2 files changed
+24
-0
lines changed- erts
- emulator/sys/unix
- preloaded/src
2 files changed
+24
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
174 | 174 | | |
175 | 175 | | |
176 | 176 | | |
| 177 | + | |
177 | 178 | | |
178 | 179 | | |
179 | 180 | | |
| |||
564 | 565 | | |
565 | 566 | | |
566 | 567 | | |
| 568 | + | |
567 | 569 | | |
568 | 570 | | |
569 | 571 | | |
| |||
572 | 574 | | |
573 | 575 | | |
574 | 576 | | |
| 577 | + | |
575 | 578 | | |
576 | 579 | | |
577 | 580 | | |
| |||
642 | 645 | | |
643 | 646 | | |
644 | 647 | | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
645 | 665 | | |
646 | 666 | | |
647 | 667 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7324 | 7324 | | |
7325 | 7325 | | |
7326 | 7326 | | |
| 7327 | + | |
| 7328 | + | |
| 7329 | + | |
| 7330 | + | |
7327 | 7331 | | |
7328 | 7332 | | |
7329 | 7333 | | |
| |||
0 commit comments