summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorkjnilsson <knilsson@pivotal.io>2018-12-03 12:57:58 +0000
committerkjnilsson <knilsson@pivotal.io>2018-12-03 12:57:58 +0000
commit812706707f300b735f22a56b7ff713cd20f4c7b9 (patch)
treedab4762ada1a9fd7013660f636b69c8dae1cc557 /src
parentd675f6854356a330e6d6ab7f6c58376cd8971a91 (diff)
downloadrabbitmq-server-git-812706707f300b735f22a56b7ff713cd20f4c7b9.tar.gz
Optimise quorum_queue SUITE
By reducing net_ticktime in the suite and base the hardcoded queue.delete on net_ticktime.
Diffstat (limited to 'src')
-rw-r--r--src/rabbit_quorum_queue.erl10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/rabbit_quorum_queue.erl b/src/rabbit_quorum_queue.erl
index 385df48c86..684f9d91d4 100644
--- a/src/rabbit_quorum_queue.erl
+++ b/src/rabbit_quorum_queue.erl
@@ -97,11 +97,12 @@
rabbit_fifo_client:state().
init_state({Name, _}, QName) ->
{ok, SoftLimit} = application:get_env(rabbit, quorum_commands_soft_limit),
- {ok, #amqqueue{pid = Leader, quorum_nodes = Nodes0}} =
+ {ok, #amqqueue{pid = Leader, quorum_nodes = Nodes}} =
rabbit_amqqueue:lookup(QName),
%% Ensure the leader is listed first
- Nodes = [Leader | lists:delete(Leader, Nodes0)],
- rabbit_fifo_client:init(QName, Nodes, SoftLimit,
+ Servers0 = [{Name, N} || N <- Nodes],
+ Servers = [Leader | lists:delete(Leader, Servers0)],
+ rabbit_fifo_client:init(QName, Servers, SoftLimit,
fun() -> credit_flow:block(Name), ok end,
fun() -> credit_flow:unblock(Name), ok end).
@@ -275,9 +276,10 @@ stop(VHost) ->
delete(#amqqueue{ type = quorum, pid = {Name, _}, name = QName, quorum_nodes = QNodes},
_IfUnused, _IfEmpty, ActingUser) ->
%% TODO Quorum queue needs to support consumer tracking for IfUnused
+ Timeout = application:get_env(kernel, net_ticktime, 60000) + 5000,
Msgs = quorum_messages(Name),
_ = rabbit_amqqueue:internal_delete(QName, ActingUser),
- case ra:delete_cluster([{Name, Node} || Node <- QNodes], 120000) of
+ case ra:delete_cluster([{Name, Node} || Node <- QNodes], Timeout) of
{ok, {_, LeaderNode} = Leader} ->
MRef = erlang:monitor(process, Leader),
receive