diff options
author | Erlang/OTP <[email protected]> | 2017-11-17 14:19:10 +0100 |
---|---|---|
committer | Erlang/OTP <[email protected]> | 2017-11-17 14:19:10 +0100 |
commit | e81e76485198a4a2de0abf882d93fb1a6880d8c2 (patch) | |
tree | 212831d11b0349f3206576fb2a3ef29e08ac555e /erts/emulator/beam/dist.c | |
parent | b291c961e83ff1fe82ee58b643919bcba434c19a (diff) | |
parent | 745c99e35283686a3a636c82e44304cd180db232 (diff) | |
download | otp-e81e76485198a4a2de0abf882d93fb1a6880d8c2.tar.gz otp-e81e76485198a4a2de0abf882d93fb1a6880d8c2.tar.bz2 otp-e81e76485198a4a2de0abf882d93fb1a6880d8c2.zip |
Merge branch 'rickard/node-mon-proc-exit-race/maint-20/OTP-14781' into maint-20
* rickard/node-mon-proc-exit-race/maint-20/OTP-14781:
Fix triggering of node monitors
Diffstat (limited to 'erts/emulator/beam/dist.c')
-rw-r--r-- | erts/emulator/beam/dist.c | 34 |
1 files changed, 18 insertions, 16 deletions
diff --git a/erts/emulator/beam/dist.c b/erts/emulator/beam/dist.c index 09fdb897f5..9fddac8980 100644 --- a/erts/emulator/beam/dist.c +++ b/erts/emulator/beam/dist.c @@ -385,22 +385,24 @@ static void doit_node_link_net_exits(ErtsLink *lnk, void *vnecp) if (!rp) goto done; erts_smp_proc_lock(rp, rp_locks); - rlnk = erts_remove_link(&ERTS_P_LINKS(rp), name); - if (rlnk != NULL) { - ASSERT(is_atom(rlnk->pid) && (rlnk->type == LINK_NODE)); - erts_destroy_link(rlnk); - } - n = ERTS_LINK_REFC(lnk); - for (i = 0; i < n; ++i) { - Eterm tup; - Eterm *hp; - ErtsMessage *msgp; - - msgp = erts_alloc_message_heap(rp, &rp_locks, - 3, &hp, &ohp); - tup = TUPLE2(hp, am_nodedown, name); - erts_queue_message(rp, rp_locks, msgp, tup, am_system); - } + if (!ERTS_PROC_IS_EXITING(rp)) { + rlnk = erts_remove_link(&ERTS_P_LINKS(rp), name); + if (rlnk != NULL) { + ASSERT(is_atom(rlnk->pid) && (rlnk->type == LINK_NODE)); + erts_destroy_link(rlnk); + } + n = ERTS_LINK_REFC(lnk); + for (i = 0; i < n; ++i) { + Eterm tup; + Eterm *hp; + ErtsMessage *msgp; + + msgp = erts_alloc_message_heap(rp, &rp_locks, + 3, &hp, &ohp); + tup = TUPLE2(hp, am_nodedown, name); + erts_queue_message(rp, rp_locks, msgp, tup, am_system); + } + } erts_smp_proc_unlock(rp, rp_locks); } done: |