diff options
author | Matthew Sackman <matthew@rabbitmq.com> | 2010-07-06 16:09:23 +0100 |
---|---|---|
committer | Matthew Sackman <matthew@rabbitmq.com> | 2010-07-06 16:09:23 +0100 |
commit | 39720759ee8778ceeb4fdc85f5d0bbc56ee7244c (patch) | |
tree | 1091830c958531baa96506b8d36e82f2a5ab5a3a /src/rabbit_connection_sup.erl | |
parent | 4c5794188c5e046ad6141573b52a323ee3aca989 (diff) | |
download | rabbitmq-server-39720759ee8778ceeb4fdc85f5d0bbc56ee7244c.tar.gz |
Added ability to stop supervisor2, which means children only need to be transient, not permanent, as we're no longer relying on reached_max_restart_intensity to nuke out the supervisor. However, we still don't quite have the error-free shutdown because supervisor still complains if it tries to stop a child and finds the child already dead.
Diffstat (limited to 'src/rabbit_connection_sup.erl')
-rw-r--r-- | src/rabbit_connection_sup.erl | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/rabbit_connection_sup.erl b/src/rabbit_connection_sup.erl index db9dc3c9..f6c4de2a 100644 --- a/src/rabbit_connection_sup.erl +++ b/src/rabbit_connection_sup.erl @@ -31,22 +31,24 @@ -module(rabbit_connection_sup). --behaviour(supervisor). +-behaviour(supervisor2). --export([start_link/0]). +-export([start_link/0, stop/1]). -export([init/1]). -include("rabbit.hrl"). start_link() -> - supervisor:start_link(?MODULE, []). + supervisor2:start_link(?MODULE, []). + +stop(Pid) -> + supervisor2:stop(Pid). init([]) -> {ok, {{one_for_all, 0, 1}, [{reader, {rabbit_reader, start_link, []}, - permanent, ?MAX_WAIT, worker, [rabbit_reader]}, + transient, ?MAX_WAIT, worker, [rabbit_reader]}, {collector, {rabbit_reader_queue_collector, start_link, []}, - permanent, ?MAX_WAIT, worker, [rabbit_reader_queue_collector]} + transient, ?MAX_WAIT, worker, [rabbit_reader_queue_collector]} ]}}. - |