summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Radestock <matthias@lshift.net>2010-04-16 14:33:17 +0100
committerMatthias Radestock <matthias@lshift.net>2010-04-16 14:33:17 +0100
commit38f3d48bdf4e8ef9919af0e380e1925ffb503c8f (patch)
treeb6f23d9a1588d7310d10975be1e891f0d4670255
parentf48db4a0bbbe15ab62922b309a2ac89af3e9a2fb (diff)
downloadrabbitmq-server-38f3d48bdf4e8ef9919af0e380e1925ffb503c8f.tar.gz
qa supervisor2 and its use in amqqueue/amqqueue_sup
Queue processes are now terminated nicely (and the supervisor waits for the termination), but this won't make any difference until queue processes trap exits and do something interesting on shutdown.
-rw-r--r--src/rabbit_amqqueue_sup.erl12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/rabbit_amqqueue_sup.erl b/src/rabbit_amqqueue_sup.erl
index dbd65780..97d6cef9 100644
--- a/src/rabbit_amqqueue_sup.erl
+++ b/src/rabbit_amqqueue_sup.erl
@@ -31,21 +31,23 @@
-module(rabbit_amqqueue_sup).
--behaviour(supervisor).
+-behaviour(supervisor2).
-export([start_link/0, start_child/1]).
-export([init/1]).
+-include("rabbit.hrl").
+
-define(SERVER, ?MODULE).
start_link() ->
- supervisor:start_link({local, ?SERVER}, ?MODULE, []).
+ supervisor2:start_link({local, ?SERVER}, ?MODULE, []).
start_child(Args) ->
- supervisor:start_child(?SERVER, Args).
+ supervisor2:start_child(?SERVER, Args).
init([]) ->
- {ok, {{simple_one_for_one, 10, 10},
+ {ok, {{simple_one_for_one_terminate, 10, 10},
[{rabbit_amqqueue, {rabbit_amqqueue_process, start_link, []},
- temporary, brutal_kill, worker, [rabbit_amqqueue_process]}]}}.
+ temporary, ?MAX_WAIT, worker, [rabbit_amqqueue_process]}]}}.