Skip to content

Commit 1552f89

Browse files
committed
Skip are_transient_nonexcl_used check on virin node
This check fails on a virin node, because the metadata store is not yet ready to handle the query. However, a virin node by definition can't have any queues, so let's just return false without asking.
1 parent 1cae417 commit 1552f89

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

deps/rabbit/src/rabbit_amqqueue.erl

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -118,12 +118,19 @@
118118
}}).
119119

120120
are_transient_nonexcl_used(_) ->
121-
case rabbit_db_queue:list_transient() of
122-
{ok, Queues} ->
123-
NonExclQueues = [Q || Q <- Queues, not is_exclusive(Q)],
124-
length(NonExclQueues) > 0;
125-
{error, _} ->
126-
undefined
121+
case rabbit_db:is_virgin_node() of
122+
true ->
123+
%% a virgin node can't have any queues and the check is performed before
124+
%% metadata store is ready, so skip the query
125+
false;
126+
false ->
127+
case rabbit_db_queue:list_transient() of
128+
{ok, Queues} ->
129+
NonExclQueues = [Q || Q <- Queues, not is_exclusive(Q)],
130+
length(NonExclQueues) > 0;
131+
{error, _} ->
132+
undefined
133+
end
127134
end.
128135

129136
-define(CONSUMER_INFO_KEYS,

0 commit comments

Comments
 (0)