summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDiana Corbacho <diana@rabbitmq.com>2018-12-04 12:18:21 +0000
committerDiana Corbacho <diana@rabbitmq.com>2018-12-04 12:18:21 +0000
commitadee8467f4e925ae472b17cf2fa0a0df0f2978ca (patch)
tree49d989841954bc3895168cd7925122b4b9d1e95b
parentcddcdba48dacd8cc4e20a1b11d8df8b156a9878a (diff)
downloadrabbitmq-server-git-adee8467f4e925ae472b17cf2fa0a0df0f2978ca.tar.gz
Give valid cluster name to rabbit_fifo_client
-rw-r--r--src/rabbit_quorum_queue.erl6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/rabbit_quorum_queue.erl b/src/rabbit_quorum_queue.erl
index 895288672a..70c3116c33 100644
--- a/src/rabbit_quorum_queue.erl
+++ b/src/rabbit_quorum_queue.erl
@@ -93,14 +93,16 @@
%%----------------------------------------------------------------------------
-spec init_state(ra_server_id(), rabbit_types:r('queue')) ->
- rabbit_fifo_client:state().
+ rabbit_fifo_client:state().
init_state({Name, _}, QName) ->
{ok, SoftLimit} = application:get_env(rabbit, quorum_commands_soft_limit),
+ %% This lookup could potentially return an {error, not_found}, but we do not
+ %% know what to do if the queue has `disappeared`. Let it crash.
{ok, #amqqueue{pid = Leader, quorum_nodes = Nodes0}} =
rabbit_amqqueue:lookup(QName),
%% Ensure the leader is listed first
Nodes = [Leader | lists:delete(Leader, [{Name, N} || N <- Nodes0])],
- rabbit_fifo_client:init(QName, Nodes, SoftLimit,
+ rabbit_fifo_client:init(qname_to_rname(QName), Nodes, SoftLimit,
fun() -> credit_flow:block(Name), ok end,
fun() -> credit_flow:unblock(Name), ok end).