summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGerhard Lazu <gerhard@lazu.co.uk>2018-02-22 15:07:59 +0000
committerGerhard Lazu <gerhard@lazu.co.uk>2018-03-27 16:07:35 +0100
commit30a1a2f76bb21b598e1f3ce5e67725032cb38701 (patch)
treea8547c6921b201d4fae18c9e8826d03945178327
parent034003932683f8669be0c743de2a3654adac78d2 (diff)
downloadrabbitmq-server-git-30a1a2f76bb21b598e1f3ce5e67725032cb38701.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
-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) ->