Skip to content

Commit 4e8098d

Browse files
Merge pull request #12840 from rabbitmq/fix-transient-queue-detection
Fix transient queue detection
2 parents 88db8c9 + 46259b5 commit 4e8098d

File tree

2 files changed

+14
-7
lines changed

2 files changed

+14
-7
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,

deps/rabbit/src/rabbit_db_queue.erl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -985,7 +985,7 @@ list_transient() ->
985985
}).
986986

987987
list_transient_in_mnesia() ->
988-
Pattern = amqqueue:pattern_match_all(),
988+
Pattern = amqqueue:pattern_match_on_durable(false),
989989
AllQueues = mnesia:dirty_match_object(
990990
?MNESIA_TABLE,
991991
Pattern),

0 commit comments

Comments
 (0)