diff options
| author | Emile Joubert <emile@rabbitmq.com> | 2011-11-01 18:28:51 +0000 |
|---|---|---|
| committer | Emile Joubert <emile@rabbitmq.com> | 2011-11-01 18:28:51 +0000 |
| commit | 3be4c1e3432ee288c552576d4b3037b4746b7e2c (patch) | |
| tree | ba2b8c57fa900c533088e3388dbb7b3f63ac37a7 /src | |
| parent | caa744fc478191b0af7babcb5de5d68934a41424 (diff) | |
| download | rabbitmq-server-git-3be4c1e3432ee288c552576d4b3037b4746b7e2c.tar.gz | |
Refactor supervisor shutdown more
Diffstat (limited to 'src')
| -rw-r--r-- | src/supervisor2.erl | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/src/supervisor2.erl b/src/supervisor2.erl index 1f75840567..3b66d4b8ff 100644 --- a/src/supervisor2.erl +++ b/src/supervisor2.erl @@ -671,13 +671,10 @@ terminate_simple_children(Child, Dynamics, SupName) -> receive {'DOWN', _, process, Pid, Reason} -> {dict:append(Pid, {error, Reason}, Replies), true} end; - {'DOWN', _MRef, process, Pid, Reason} - when Child#child.shutdown == brutal_kill andalso - Reason == killed andalso Timedout == false orelse - Reason == shutdown andalso Timedout == false -> - {dict:append(Pid, ok, Replies), Timedout}; {'DOWN', _MRef, process, Pid, Reason} -> - {dict:append(Pid, {error, Reason}, Replies), Timedout}; + {dict:append(Pid, child_tally(Child#child.shutdown, + Reason, Timedout), + Replies), Timedout}; {'EXIT', Pid, Reason} -> receive {'DOWN', _MRef, process, Pid, _} -> {dict:append(Pid, {error, Reason}, Replies), Timedout} @@ -707,9 +704,15 @@ terminate_simple_children(Child, Dynamics, SupName) -> end, ok, Replies), ok. +child_tally(Shutdown, Reason, Timedout) + when Shutdown == brutal_kill andalso Reason == killed andalso + Timedout == false orelse Reason == shutdown andalso + Timedout == false -> ok; +child_tally(_Shutdown, Reason, _Timedout) -> {error, Reason}. + restart_permanent(permanent) -> true; restart_permanent({permanent, _Delay}) -> true; -restart_permanent(_) -> false; +restart_permanent(_) -> false. do_terminate(Child, SupName) when Child#child.pid =/= undefined -> ReportError = shutdown_error_reporter(SupName), |
