Skip to content

Commit 5535432

Browse files
Merge pull request #8785 from rabbitmq/mergify/bp/v3.11.x/pr-8783
Fix combination of `amqqueue:get_pid/1` and `node/1` (backport #8747) (backport #8783)
2 parents e18b3b5 + 78745a6 commit 5535432

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

deps/rabbit/src/rabbit_classic_queue.erl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,9 +115,9 @@ delete(Q, IfUnused, IfEmpty, ActingUser) when ?amqqueue_is_classic(Q) ->
115115
{ok, 0}
116116
end.
117117

118-
is_recoverable(Q) when ?is_amqqueue(Q) ->
118+
is_recoverable(Q) when ?is_amqqueue(Q) and ?amqqueue_is_classic(Q) ->
119119
Node = node(),
120-
Node =:= node(amqqueue:get_pid(Q)) andalso
120+
Node =:= amqqueue:qnode(Q) andalso
121121
%% Terminations on node down will not remove the rabbit_queue
122122
%% record if it is a mirrored queue (such info is now obtained from
123123
%% the policy). Thus, we must check if the local pid is alive

deps/rabbit/src/rabbit_quorum_queue.erl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -560,7 +560,7 @@ reductions(Name) ->
560560
0
561561
end.
562562

563-
is_recoverable(Q) ->
563+
is_recoverable(Q) when ?is_amqqueue(Q) and ?amqqueue_is_quorum(Q) ->
564564
Node = node(),
565565
Nodes = get_nodes(Q),
566566
lists:member(Node, Nodes).

0 commit comments

Comments
 (0)