I found some queues aren't display in list_queues command, but I can use curl to get the information of these queues
##################################################################
##################################################################
This is the status of the queue named notifications.sample
##################################################################
{
"garbage_collection": {
"max_heap_size": -1,
"min_bin_vheap_size": -1,
"min_heap_size": -1,
"fullsweep_after": -1,
"minor_gcs": -1
},
"consumer_details": [
],
"incoming": [
],
"deliveries": [
],
"node": "rabbit@rabbitmqNode0",
"arguments": {
},
"exclusive": false,
"auto_delete": false,
"durable": false,
"vhost": "/",
"name": "notifications.sample"
}
##################################################################
I think maybe some information of notifications.sample queue maybe losted during mirrord queue synchronisation, so that I can't decalre the queue with the same name.
So I want to delete these abnormal queues if the queue is abnormal like below. But I'm nor sure this change could cause any other problems.
rabbitmq-server-3.7.6/deps/rabbit/src/rabbit_amqqueue.erl
##################################################################
with(Name, F, E, RetriesLeft) ->
case lookup(Name) of
{ok, Q = #amqqueue{state = live, name = Qname, pid = QPid, slave_pids = SPids}} when RetriesLeft =:= 0 ->
%% Something bad happened to that queue, we are bailing out
%% on processing current request.
internal_delete(Qname, ?INTERNAL_USER),
Pids = [QPid | SPids],
delete_immediately(Pids),
E({absent, Q, timeout});
{ok, Q = #amqqueue{state = stopped}} when RetriesLeft =:= 0 ->
%% The queue was stopped and not migrated
E({absent, Q, stopped});
%% The queue process has crashed with unknown error
{ok, Q = #amqqueue{state = crashed}} ->
E({absent, Q, crashed});
%% The queue process has been stopped by a supervisor.
%% In that case a synchronised slave can take over
%% so we should retry.
{ok, Q = #amqqueue{state = stopped}} ->
%% The queue process was stopped by the supervisor
rabbit_misc:with_exit_handler(
fun () -> retry_wait(Q, F, E, RetriesLeft) end,
fun () -> F(Q) end);
%% The queue is supposed to be active.
%% The master node can go away or queue can be killed
%% so we retry, waiting for a slave to take over.
{ok, Q = #amqqueue{state = live}} ->
%% We check is_process_alive(QPid) in case we receive a
%% nodedown (for example) in F() that has nothing to do
%% with the QPid. F() should be written s.t. that this
%% cannot happen, so we bail if it does since that
%% indicates a code bug and we don't want to get stuck in
%% the retry loop.
rabbit_misc:with_exit_handler(
fun () -> retry_wait(Q, F, E, RetriesLeft) end,
fun () -> F(Q) end);
{error, not_found} ->
E(not_found_or_absent_dirty(Name))
end.
##################################################################
Thanke you.