aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/erl_process.c
diff options
context:
space:
mode:
authorSverker Eriksson <[email protected]>2019-02-19 15:16:38 +0100
committerSverker Eriksson <[email protected]>2019-02-19 15:16:38 +0100
commit80b04507b0456a73f2f2f001691cadb4cb3958e8 (patch)
treefaf7a6ca2e848d9d69895cb58cddcf8a7fbfed75 /erts/emulator/beam/erl_process.c
parentabd688e595b7c9daf4bd15b7792d83b5f52332d9 (diff)
parent750e9be58c7c245d49d6a7227b972bf0fd8c09ab (diff)
downloadotp-80b04507b0456a73f2f2f001691cadb4cb3958e8.tar.gz
otp-80b04507b0456a73f2f2f001691cadb4cb3958e8.tar.bz2
otp-80b04507b0456a73f2f2f001691cadb4cb3958e8.zip
Merge branch 'sverker/heart-nice-exit/OTP-15599' into maint
* sverker/heart-nice-exit/OTP-15599: erts: Avoid heart killing a nicely exiting emulator
Diffstat (limited to 'erts/emulator/beam/erl_process.c')
-rw-r--r--erts/emulator/beam/erl_process.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/erts/emulator/beam/erl_process.c b/erts/emulator/beam/erl_process.c
index dca502c939..cc02fbad1e 100644
--- a/erts/emulator/beam/erl_process.c
+++ b/erts/emulator/beam/erl_process.c
@@ -2462,6 +2462,13 @@ handle_reap_ports(ErtsAuxWorkData *awdp, erts_aint32_t aux_work, int waiting)
erts_port_lock(prt);
+ if (prt->common.u.alive.reg &&
+ prt->common.u.alive.reg->name == am_heart_port) {
+ /* Leave heart port to not get killed before flushing is done*/
+ erts_port_release(prt);
+ continue;
+ }
+
state = erts_atomic32_read_nob(&prt->state);
if (!(state & (ERTS_PORT_SFLGS_INVALID_DRIVER_LOOKUP
| ERTS_PORT_SFLG_HALT))) {