diff options
author | Matthew Sackman <matthew@lshift.net> | 2010-03-08 15:12:24 +0000 |
---|---|---|
committer | Matthew Sackman <matthew@lshift.net> | 2010-03-08 15:12:24 +0000 |
commit | 4b876e1f97df23caa45c4fd65d07448890a71f82 (patch) | |
tree | 5e7dde5fef746505265381bc06a4b8c3c52034af | |
parent | 5c8370ea6fdb5014ebfd74d5db94100c4456b763 (diff) | |
download | rabbitmq-server-4b876e1f97df23caa45c4fd65d07448890a71f82.tar.gz |
Extended all timeouts
-rw-r--r-- | include/rabbit.hrl | 2 | ||||
-rw-r--r-- | src/pg_local.erl | 2 | ||||
-rw-r--r-- | src/rabbit.erl | 15 | ||||
-rw-r--r-- | src/rabbit_restartable_sup.erl | 7 | ||||
-rw-r--r-- | src/rabbit_sup.erl | 7 | ||||
-rw-r--r-- | src/tcp_listener_sup.erl | 4 |
6 files changed, 22 insertions, 15 deletions
diff --git a/include/rabbit.hrl b/include/rabbit.hrl index e2980eff..38142491 100644 --- a/include/rabbit.hrl +++ b/include/rabbit.hrl @@ -173,6 +173,8 @@ -define(COPYRIGHT_MESSAGE, "Copyright (C) 2007-2010 LShift Ltd., Cohesive Financial Technologies LLC., and Rabbit Technologies Ltd."). -define(INFORMATION_MESSAGE, "Licensed under the MPL. See http://www.rabbitmq.com/"). +-define(MAX_WAIT, 16#ffffffff). + -ifdef(debug). -define(LOGDEBUG0(F), rabbit_log:debug(F)). -define(LOGDEBUG(F,A), rabbit_log:debug(F,A)). diff --git a/src/pg_local.erl b/src/pg_local.erl index fa41fe46..1501331d 100644 --- a/src/pg_local.erl +++ b/src/pg_local.erl @@ -206,7 +206,7 @@ ensure_started() -> case whereis(?MODULE) of undefined -> C = {pg_local, {?MODULE, start_link, []}, permanent, - 1000, worker, [?MODULE]}, + 16#ffffffff, worker, [?MODULE]}, supervisor:start_child(kernel_safe_sup, C); PgLocalPid -> {ok, PgLocalPid} diff --git a/src/rabbit.erl b/src/rabbit.erl index 94d852f9..326893ca 100644 --- a/src/rabbit.erl +++ b/src/rabbit.erl @@ -197,15 +197,12 @@ stop() -> ok = rabbit_misc:stop_applications(?APPS). stop_and_halt() -> - spawn(fun () -> - SleepTime = 1000, - rabbit_log:info("Stop-and-halt request received; " - "halting in ~p milliseconds~n", - [SleepTime]), - timer:sleep(SleepTime), - init:stop() - end), - case catch stop() of _ -> ok end. + try + stop() + after + init:stop() + end, + ok. status() -> [{running_applications, application:which_applications()}] ++ diff --git a/src/rabbit_restartable_sup.erl b/src/rabbit_restartable_sup.erl index bc6f40da..2f90cb99 100644 --- a/src/rabbit_restartable_sup.erl +++ b/src/rabbit_restartable_sup.erl @@ -37,6 +37,8 @@ -export([init/1]). +-include("rabbit.hrl"). + -define(SERVER, ?MODULE). start_link() -> @@ -46,8 +48,9 @@ start_child(Mod) -> start_child(Mod, []). start_child(Mod, Args) -> - {ok, _} = supervisor:start_child(?SERVER, {Mod, {Mod, start_link, Args}, - transient, 100, worker, [Mod]}), + {ok, _} = supervisor:start_child(?SERVER, + {Mod, {Mod, start_link, Args}, + transient, ?MAX_WAIT, worker, [Mod]}), ok. init([]) -> diff --git a/src/rabbit_sup.erl b/src/rabbit_sup.erl index 7525db41..03fc9fb9 100644 --- a/src/rabbit_sup.erl +++ b/src/rabbit_sup.erl @@ -37,6 +37,8 @@ -export([init/1]). +-include("rabbit.hrl"). + -define(SERVER, ?MODULE). start_link() -> @@ -46,8 +48,9 @@ start_child(Mod) -> start_child(Mod, []). start_child(Mod, Args) -> - {ok, _} = supervisor:start_child(?SERVER, {Mod, {Mod, start_link, Args}, - transient, 100, worker, [Mod]}), + {ok, _} = supervisor:start_child(?SERVER, + {Mod, {Mod, start_link, Args}, + transient, ?MAX_WAIT, worker, [Mod]}), ok. init([]) -> diff --git a/src/tcp_listener_sup.erl b/src/tcp_listener_sup.erl index 0fe15426..b1526d5e 100644 --- a/src/tcp_listener_sup.erl +++ b/src/tcp_listener_sup.erl @@ -37,6 +37,8 @@ -export([init/1]). +-include("rabbit.hrl"). + start_link(IPAddress, Port, SocketOpts, OnStartup, OnShutdown, AcceptCallback, Label) -> start_link(IPAddress, Port, SocketOpts, OnStartup, OnShutdown, @@ -63,4 +65,4 @@ init({IPAddress, Port, SocketOpts, OnStartup, OnShutdown, [IPAddress, Port, SocketOpts, ConcurrentAcceptorCount, Name, OnStartup, OnShutdown, Label]}, - transient, 100, worker, [tcp_listener]}]}}. + transient, ?MAX_WAIT, worker, [tcp_listener]}]}}. |