Skip to content

Commit

Permalink
erts: Unwrap supervised shutdown reasons for distr controller
Browse files Browse the repository at this point in the history
  • Loading branch information
sverker committed Feb 23, 2022
1 parent 97e736e commit ad9c5af
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions erts/emulator/beam/atom.names
Expand Up @@ -629,6 +629,7 @@ atom set_on_spawn
atom set_seq_token
atom set_tcw
atom set_tcw_fake
atom shutdown
atom sighup
atom sigterm
atom sigusr1
Expand Down
9 changes: 9 additions & 0 deletions erts/emulator/beam/dist.c
Expand Up @@ -965,6 +965,15 @@ int erts_do_net_exits(DistEntry *dep, Eterm reason)
if (erts_port_task_is_scheduled(&dep->dist_cmd))
erts_port_task_abort(&dep->dist_cmd);
}
else {
ASSERT(is_internal_pid(dep->cid));
/* Unwrap supervised shutdown reasons: {shutdown,R} -> R */
if (is_tuple_arity(reason, 2)) {
Eterm* tpl = tuple_val(reason);
if (tpl[1] == am_shutdown)
reason = tpl[2];
}
}

if (dep->state == ERTS_DE_STATE_EXITING) {
ASSERT(erts_atomic32_read_nob(&dep->qflgs) & ERTS_DE_QFLG_EXIT);
Expand Down

0 comments on commit ad9c5af

Please sign in to comment.