diff options
author | Emile Joubert <emile@rabbitmq.com> | 2013-10-28 16:43:55 +0000 |
---|---|---|
committer | Emile Joubert <emile@rabbitmq.com> | 2013-10-28 16:43:55 +0000 |
commit | cf185daa0923d2fa60fa4047bc7e8b208f3a22ed (patch) | |
tree | c78826db43e269487cd66a0251df073fe95e3e43 | |
parent | 12a34ab4f1be4c18004c581b2ff16707c90f6b32 (diff) | |
parent | 7bb9fc0bb5f3ba51dc5014e6eea3f212b4d98c9a (diff) | |
download | rabbitmq-server-cf185daa0923d2fa60fa4047bc7e8b208f3a22ed.tar.gz |
Merged bug25838 into stable
-rwxr-xr-x | check_xref | 7 | ||||
-rw-r--r-- | src/rabbit_channel.erl | 3 | ||||
-rw-r--r-- | src/rabbit_limiter.erl | 16 |
3 files changed, 18 insertions, 8 deletions
@@ -136,6 +136,13 @@ checks() -> error, filters()}, {"(Lin) (L - LU)", "has unused local function(s)", error, filters()}, + %% E - all edges (i.e. function calls) + %% | - calling from + %% || - calling to + %% "RE1" : "RE2" / "RE3" - regex MFA + {"(E | \"(rabbit|amqp).*\" : _ / _ || \"gen_server2?\" : call / 2)", + "5 sec timeout in", + error, filters()}, {"(Lin) (LU * (X - XU))", "has exported function(s) only used locally", warning, filters()}, diff --git a/src/rabbit_channel.erl b/src/rabbit_channel.erl index dc37959b..a3a0c754 100644 --- a/src/rabbit_channel.erl +++ b/src/rabbit_channel.erl @@ -177,7 +177,8 @@ info_all(Items) -> refresh_config_local() -> rabbit_misc:upmap( - fun (C) -> gen_server2:call(C, refresh_config) end, list_local()), + fun (C) -> gen_server2:call(C, refresh_config, infinity) end, + list_local()), ok. ready_for_close(Pid) -> diff --git a/src/rabbit_limiter.erl b/src/rabbit_limiter.erl index 12a13c00..22da465b 100644 --- a/src/rabbit_limiter.erl +++ b/src/rabbit_limiter.erl @@ -197,24 +197,25 @@ start_link() -> gen_server2:start_link(?MODULE, [], []). new(Pid) -> %% this a 'call' to ensure that it is invoked at most once. - ok = gen_server:call(Pid, {new, self()}), + ok = gen_server:call(Pid, {new, self()}, infinity), #lstate{pid = Pid, prefetch_limited = false, blocked = false}. limit_prefetch(L, PrefetchCount, UnackedCount) when PrefetchCount > 0 -> - ok = gen_server:call(L#lstate.pid, - {limit_prefetch, PrefetchCount, UnackedCount}), + ok = gen_server:call( + L#lstate.pid, + {limit_prefetch, PrefetchCount, UnackedCount}, infinity), L#lstate{prefetch_limited = true}. unlimit_prefetch(L) -> - ok = gen_server:call(L#lstate.pid, unlimit_prefetch), + ok = gen_server:call(L#lstate.pid, unlimit_prefetch, infinity), L#lstate{prefetch_limited = false}. block(L) -> - ok = gen_server:call(L#lstate.pid, block), + ok = gen_server:call(L#lstate.pid, block, infinity), L#lstate{blocked = true}. unblock(L) -> - ok = gen_server:call(L#lstate.pid, unblock), + ok = gen_server:call(L#lstate.pid, unblock, infinity), L#lstate{blocked = false}. is_prefetch_limited(#lstate{prefetch_limited = Limited}) -> Limited. @@ -224,7 +225,8 @@ is_blocked(#lstate{blocked = Blocked}) -> Blocked. is_active(L) -> is_prefetch_limited(L) orelse is_blocked(L). get_prefetch_limit(#lstate{prefetch_limited = false}) -> 0; -get_prefetch_limit(L) -> gen_server:call(L#lstate.pid, get_prefetch_limit). +get_prefetch_limit(L) -> + gen_server:call(L#lstate.pid, get_prefetch_limit, infinity). ack(#lstate{prefetch_limited = false}, _AckCount) -> ok; ack(L, AckCount) -> gen_server:cast(L#lstate.pid, {ack, AckCount}). |