aboutsummaryrefslogtreecommitdiffstats
path: root/erts
diff options
context:
space:
mode:
authorErlang/OTP <[email protected]>2017-12-15 16:03:30 +0100
committerErlang/OTP <[email protected]>2017-12-15 16:03:30 +0100
commitb38309e7a1e323fdc518f6e88e31a1a3e3082599 (patch)
tree1533655a2c03bd80ce77aad9db5b69679959dce4 /erts
parentcb45b92217dd06dbba3762059da56ecac9be600b (diff)
parent19e8943798f8ef282a8c2b4da26176f07c3652d5 (diff)
downloadotp-b38309e7a1e323fdc518f6e88e31a1a3e3082599.tar.gz
otp-b38309e7a1e323fdc518f6e88e31a1a3e3082599.tar.bz2
otp-b38309e7a1e323fdc518f6e88e31a1a3e3082599.zip
Merge branch 'rickard/node-mon-proc-exit-race/OTP-14781' into maint-19
* rickard/node-mon-proc-exit-race/OTP-14781: Fix triggering of node monitors
Diffstat (limited to 'erts')
-rw-r--r--erts/emulator/beam/dist.c34
1 files changed, 18 insertions, 16 deletions
diff --git a/erts/emulator/beam/dist.c b/erts/emulator/beam/dist.c
index 3611eeee02..5566055de0 100644
--- a/erts/emulator/beam/dist.c
+++ b/erts/emulator/beam/dist.c
@@ -383,22 +383,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: