Skip to content

Commit

Permalink
mgt: only mark domains as shutdown that have a "normal" exit status
Browse files Browse the repository at this point in the history
fixes #170
  • Loading branch information
verbit committed Aug 4, 2024
1 parent a996485 commit 499d116
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions apps/virtuerl/src/virtuerl_mgt.erl
Original file line number Diff line number Diff line change
Expand Up @@ -333,15 +333,15 @@ handle_info({nodedown, _Node}, State) ->
{noreply, State};
handle_info({nodeup, _Node}, State) ->
{noreply, State, {continue, sync_domains}};
handle_info({'DOWN', _, process, Pid, Reason}, #state{table = Table, idmap = IdMap} = State) ->
handle_info({'DOWN', _, process, Pid, normal}, #state{table = Table, idmap = IdMap} = State) ->
NewIdMap = case IdMap of
#{Pid := DomId} ->
[{DomId, Domain}] = dets:lookup(Table, DomId), % TODO: this is empty for a deleted domain
ok = dets:insert(Table, {DomId, Domain#{state => stopped}}),
ok = dets:sync(Table),
maps:remove(Pid, IdMap);
#{} ->
?LOG_WARNING(#{module => ?MODULE, msg => "process down but not in registry", pid => Pid, reason => Reason}),
?LOG_WARNING(#{module => ?MODULE, msg => "process down but not in registry", pid => Pid}),
IdMap
end,
{noreply, State#state{idmap = NewIdMap}};
Expand Down

0 comments on commit 499d116

Please sign in to comment.