diff options
author | Sverker Eriksson <sverker@erlang.org> | 2020-06-23 14:17:21 +0200 |
---|---|---|
committer | Sverker Eriksson <sverker@erlang.org> | 2020-07-02 12:34:54 +0200 |
commit | 2bb7e4844c8a5a76e6f1197137b763dca39764e4 (patch) | |
tree | 23c18175dbbb571c738a7ef4dd39029277ecab97 | |
parent | 6d5a5f31c36bbdaad21585d25974177bd1b75e66 (diff) | |
download | erlang-2bb7e4844c8a5a76e6f1197137b763dca39764e4.tar.gz |
sasl: Be more resilient of exiting processes
when asking about their status.
If Proc dies during sys:get_status(Proc), then treat that the
same as if it died before the call (noproc).
The case of disconnection is unchanged. Not because I'm convinced
it's the correct thing to do, but rather because I'm not convinced
it's wrong.
-rw-r--r-- | lib/sasl/src/release_handler_1.erl | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/lib/sasl/src/release_handler_1.erl b/lib/sasl/src/release_handler_1.erl index de525b292d..ddaa5c7577 100644 --- a/lib/sasl/src/release_handler_1.erl +++ b/lib/sasl/src/release_handler_1.erl @@ -659,16 +659,25 @@ get_proc_state(Proc) -> {status, _, {module, _}, [_, State, _, _, _]} when State == running ; State == suspended -> State - catch exit:{noproc, {sys, get_status, [Proc]}} -> + catch exit:{Reason, {sys, get_status, [Proc]}} + when Reason =/= timeout andalso + not (is_tuple(Reason) andalso + element(1,Reason) =:= nodedown) -> noproc end. maybe_get_dynamic_mods(Name, Pid) -> - case catch gen:call(Pid, self(), get_modules) of + try gen:call(Pid, self(), get_modules) of {ok, Res} -> - Res; - Other -> - error_logger:error_msg("release_handler: ~p~nerror during a" + Res + catch + exit:Reason when Reason =/= timeout andalso + not (is_tuple(Reason) andalso + element(1,Reason) =:= nodedown) -> + []; + exit:Other -> + error_logger:error_msg("release_handler: {'EXIT',~p}~n" + "error during a" " get_modules call to ~p (~w)," " there may be an error in it's" " childspec. Exiting ...~n", |