summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGerhard Lazu <gerhard@lazu.co.uk>2018-02-22 15:07:59 +0000
committerMichael Klishin <michael@clojurewerkz.org>2018-03-28 00:56:35 +0300
commitc9843f9a561da2a1ddce55c821d6877108cfd0d6 (patch)
treef784c56d1593f481764d09e0d93229f21aecfdc8 /src
parent11e8070f83b7a04c90a40b6cbd7c576bf67ca4e5 (diff)
downloadrabbitmq-server-git-c9843f9a561da2a1ddce55c821d6877108cfd0d6.tar.gz
Wait at most 5 secs for a node to reply to rabbit_node_monitor:partitions/0
When rabbit_node_monitor that runs on an alive node is busy cleaning after another node goes down, the process might not respond for a long time. Since the Management API calls rabbit_node_monitor:partitions/0 and blocks until this function returns, the Management UI will fail to load for a really long time - clients will timeout before this function returns. This change will make rabbit_node_monitor:partitions/0 timeout after 5 seconds so that the Management API returns in a timely manner and the Management UI blocks for an extra 5 seconds at most. The implications of this will result in node metrics being outdated, which is not ideal, but at least the users will have some feedback and will be able to perform action via the Management UI / API. For more context, see #1513 Partner-in-crime: @essen
Diffstat (limited to 'src')
-rw-r--r--src/rabbit_node_monitor.erl3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/rabbit_node_monitor.erl b/src/rabbit_node_monitor.erl
index 565676af3c..4a362eb8a2 100644
--- a/src/rabbit_node_monitor.erl
+++ b/src/rabbit_node_monitor.erl
@@ -37,6 +37,7 @@
alive_nodes/1, alive_rabbit_nodes/1]).
-define(SERVER, ?MODULE).
+-define(NODE_REPLY_TIMEOUT, 5000).
-define(RABBIT_UP_RPC_TIMEOUT, 2000).
-define(RABBIT_DOWN_PING_INTERVAL, 1000).
@@ -181,7 +182,7 @@ partitions() ->
gen_server:call(?SERVER, partitions, infinity).
partitions(Nodes) ->
- {Replies, _} = gen_server:multi_call(Nodes, ?SERVER, partitions, infinity),
+ {Replies, _} = gen_server:multi_call(Nodes, ?SERVER, partitions, ?NODE_REPLY_TIMEOUT),
Replies.
status(Nodes) ->