summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDaniil Fedotov <hairyhum@gmail.com>2018-01-19 16:50:19 +0000
committerDaniil Fedotov <hairyhum@gmail.com>2018-01-19 16:50:19 +0000
commit04f0b135931ae699d9fbd7a26ee928347df945c6 (patch)
tree31f4c414f4a4a942f014750a5367845f8dce8f7a /src
parent0b1417dfe70ef92121077507d6508a5c7d757bc2 (diff)
downloadrabbitmq-server-git-04f0b135931ae699d9fbd7a26ee928347df945c6.tar.gz
Make sure rabbit_misc:pmap callbacks do not throw.
rabbit_misc:pmap/2 can hang if a callback throws an error. This can cause plugin startup to hang when enabling channel interceptors. Made it log errors and continue. [#153846585]
Diffstat (limited to 'src')
-rw-r--r--src/rabbit_channel.erl20
1 files changed, 18 insertions, 2 deletions
diff --git a/src/rabbit_channel.erl b/src/rabbit_channel.erl
index edb782f9f9..171a4dd8a7 100644
--- a/src/rabbit_channel.erl
+++ b/src/rabbit_channel.erl
@@ -361,13 +361,29 @@ emit_info(PidList, InfoItems, Ref, AggregatorPid) ->
refresh_config_local() ->
rabbit_misc:upmap(
- fun (C) -> gen_server2:call(C, refresh_config, infinity) end,
+ fun (C) ->
+ try
+ gen_server2:call(C, refresh_config, infinity)
+ catch _:Reason ->
+ rabbit_log:error("Failed to refresh channel config "
+ "for channel ~p. Reason ~p",
+ [C, Reason])
+ end
+ end,
list_local()),
ok.
refresh_interceptors() ->
rabbit_misc:upmap(
- fun (C) -> gen_server2:call(C, refresh_interceptors, ?REFRESH_TIMEOUT) end,
+ fun (C) ->
+ try
+ gen_server2:call(C, refresh_interceptors, ?REFRESH_TIMEOUT)
+ catch _:Reason ->
+ rabbit_log:error("Failed to refresh channel interceptors "
+ "for channel ~p. Reason ~p",
+ [C, Reason])
+ end
+ end,
list_local()),
ok.