Hi,
I am using rabbitmq.Because of the batch restart of components, a large number of connections broken and reconnected for a period of time.After that, several processes failed to send the message. The call stack is as follows, but the consumer receives the message and reports a lot of duplicate message logs.It is because the rabbitmq not send ack to the publisher.
I found a suspicious queue by running the command "rabbitmqctl eval 'rabbit_diagnostics:maybe_stuck().'"(the result is as follows), and the same error occurred when I sent a message to the queue through my test script.
Found 6 suspicious processes.
[{pid,<6404.114.0>},
{registered_name,[]},
{current_stacktrace,[{worker_pool_worker,run,2,[]},
{worker_pool_worker,handle_call,3,[]},
{gen_server2,handle_msg,2,[]},
{proc_lib,wake_up,3,
[{file,"proc_lib.erl"},{line,250}]}]},
{initial_call,{proc_lib,init_p,5}},
{dictionary,[{'$ancestors',[worker_pool_sup,rabbit_sup,<6404.87.0>]},
{worker_pool_worker,true},
{'$initial_call',{gen,init_it,6}}]},
{message_queue_len,0},
{links,[<6404.106.0>,<6404.1159.73>]},
{monitors,[]},
{monitored_by,[<6404.104.0>,<6404.107.0>,<6404.24861.72>]},
{heap_size,376}]
[{pid,<6404.24861.72>},
{registered_name,[]},
{current_stacktrace,
[{gen,do_call,4,[{file,"gen.erl"},{line,168}]},
{gen_server2,call,3,[]},
{rabbit_misc,execute_mnesia_transaction,1,
[{file,"src/rabbit_misc.erl"},{line,530}]},
{rabbit_misc,execute_mnesia_tx_with_tail,1,
[{file,"src/rabbit_misc.erl"},{line,572}]},
{rabbit_amqqueue_process,'-terminate_delete/3-fun-1-',6,[]},
{rabbit_amqqueue_process,terminate_shutdown,2,[]},
{gen_server2,terminate,3,[]},
{proc_lib,wake_up,3,[{file,"proc_lib.erl"},{line,250}]}]},
{initial_call,{proc_lib,init_p,5}},
{dictionary,
[{{xtype_to_module,direct},rabbit_exchange_type_direct},
{'$ancestors',
[<6404.24807.72>,rabbit_amqqueue_sup_sup,rabbit_sup,<6404.87.0>]},
{process_name,
{rabbit_amqqueue_process,
{resource,<<"/">>,queue,
<<"q-agent-notifier-l2pation-update_fanout_497f9863489e424f87e97aee3e11b3ae">>}}},
{'$initial_call',{gen,init_it,6}},
{guid,{{3585719385,3740494773,3798005005,4196272880},0}}]},
{message_queue_len,6761},
{links,[<6404.24807.72>]},
{monitors,[{process,<6404.114.0>}]},
{monitored_by,
[<6404.18372.160>,<6404.299.0>,<6404.11487.141>,<6404.12726.137>,
<6404.17385.137>,<6404.104.0>,<6404.19873.160>,<6404.17444.160>,
<6404.17283.160>,<6404.17942.160>,<6404.18523.160>,<6404.17776.160>,
<6404.16390.160>,<6404.18500.160>,<6404.16935.160>,<6404.2005.160>,
<6404.17894.160>,<6404.2545.160>,<6404.18221.160>,<6404.20078.160>,
<6404.2007.160>]},
{heap_size,833026}]
[{pid,<6404.1159.73>},
{registered_name,[]},
{current_stacktrace,
[{timer,sleep,1,[{file,"timer.erl"},{line,153}]},
{mnesia_tm,restart,9,[{file,"mnesia_tm.erl"},{line,914}]},
{rabbit_misc,'-execute_mnesia_transaction/1-fun-0-',1,
[{file,"src/rabbit_misc.erl"},{line,534}]},
{worker_pool_worker,'-run/2-fun-0-',3,[]}]},
{initial_call,{erlang,apply,2}},
{dictionary,
[{mnesia_activity_state,
{mnesia,{tid,709989,<6404.1159.73>},{tidstore,2907979901,[],1}}},
{random_seed,{10057,8283,23562}},
{worker_pool_worker,true}]},
{message_queue_len,3},
{links,[<6404.114.0>,<6404.152.0>]},
{monitors,[]},
{monitored_by,[]},
{heap_size,376}]
[{pid,<6404.11487.141>},
{registered_name,[]},
{current_stacktrace,
[{gen,do_call,4,[{file,"gen.erl"},{line,168}]},
{gen_server2,call,3,[]},
{rabbit_amqqueue,info,2,[{file,"src/rabbit_amqqueue.erl"},{line,561}]},
{rabbit_misc,with_exit_handler,2,
[{file,"src/rabbit_misc.erl"},{line,495}]},
{rabbit_misc,'-filter_exit_map/2-lc$^0/1-0-',3,
[{file,"src/rabbit_misc.erl"},{line,508}]},
{rabbit_misc,'-filter_exit_map/2-lc$^0/1-0-',3,
[{file,"src/rabbit_misc.erl"},{line,510}]},
{rabbit_misc,filter_exit_map,2,
[{file,"src/rabbit_misc.erl"},{line,508}]},
{rabbit_amqqueue,info_all,2,
[{file,"src/rabbit_amqqueue.erl"},{line,590}]}]},
{initial_call,{erlang,apply,2}},
{dictionary,[{delegate,delegate_3}]},
{message_queue_len,0},
{links,[]},
{monitors,[{process,<6404.24861.72>}]},
{monitored_by,[<6404.14.0>]},
{heap_size,121536}]
[{pid,<6404.12726.137>},
{registered_name,[]},
{current_stacktrace,
[{gen,do_call,4,[{file,"gen.erl"},{line,168}]},
{gen_server2,call,3,[]},
{rabbit_amqqueue,info,2,[{file,"src/rabbit_amqqueue.erl"},{line,561}]},
{rabbit_misc,with_exit_handler,2,
[{file,"src/rabbit_misc.erl"},{line,495}]},
{rabbit_misc,'-filter_exit_map/2-lc$^0/1-0-',3,
[{file,"src/rabbit_misc.erl"},{line,508}]},
{rabbit_misc,'-filter_exit_map/2-lc$^0/1-0-',3,
[{file,"src/rabbit_misc.erl"},{line,510}]},
{rabbit_misc,filter_exit_map,2,
[{file,"src/rabbit_misc.erl"},{line,508}]},
{rabbit_amqqueue,info_all,2,
[{file,"src/rabbit_amqqueue.erl"},{line,590}]}]},
{initial_call,{erlang,apply,2}},
{dictionary,[{delegate,delegate_14}]},
{message_queue_len,0},
{links,[]},
{monitors,[{process,<6404.24861.72>}]},
{monitored_by,[<6404.14.0>]},
{heap_size,196650}]
[{pid,<6404.17385.137>},
{registered_name,[]},
{current_stacktrace,
[{gen,do_call,4,[{file,"gen.erl"},{line,168}]},
{gen_server2,call,3,[]},
{rabbit_amqqueue,info,2,[{file,"src/rabbit_amqqueue.erl"},{line,561}]},
{rabbit_misc,with_exit_handler,2,
[{file,"src/rabbit_misc.erl"},{line,495}]},
{rabbit_misc,'-filter_exit_map/2-lc$^0/1-0-',3,
[{file,"src/rabbit_misc.erl"},{line,508}]},
{rabbit_misc,'-filter_exit_map/2-lc$^0/1-0-',3,
[{file,"src/rabbit_misc.erl"},{line,510}]},
{rabbit_misc,filter_exit_map,2,
[{file,"src/rabbit_misc.erl"},{line,508}]},
{rabbit_amqqueue,info_all,2,
[{file,"src/rabbit_amqqueue.erl"},{line,590}]}]},
{initial_call,{erlang,apply,2}},
{dictionary,[{delegate,delegate_5}]},
{message_queue_len,0},
{links,[]},
{monitors,[{process,<6404.24861.72>}]},
{monitored_by,[<6404.14.0>]},
{heap_size,121536}]
ok
Therefore, it is suspected that there is a error with this queue and resulting this problem. The details of the suspicious queue are as follows. Compared with the detailed information of the normal queue, you can find that there is no slave pid and gm_pids.
{ok,#amqqueue{name = #resource{virtual_host = <<"/">>,
kind = queue,
name = <<"q-agent-notifier-l2pation-update_fanout_497f9863489e424f87e97aee3e11b3ae">>},
durable = false,auto_delete = false,exclusive_owner = none,
arguments = [{<<"x-expires">>,signedint,600000}],
pid = <0.24861.72>,slave_pids = [],sync_slave_pids = [],
down_slave_nodes = [],
policy = [{vhost,<<"/">>},
{name,<<"ha_all_queue">>},
{pattern,<<"^">>},
{'apply-to',<<"queues">>},
{definition,[{<<"ha-mode">>,<<"all">>},
{<<"ha-sync-mode">>,<<"automatic">>},
{<<"max-length">>,46600},
{<<"message-ttl">>,46400000}]},
{priority,1}],
gm_pids = [],decorators = [],state = live}}
the normal queues:
{ok,#amqqueue{name = #resource{virtual_host = <<"/">>,
kind = queue,
name = <<"q-agent-notifier-l2pation-update_fanout_010f35aeea4b415189dc2f5b9b6062ad">>},
durable = false,auto_delete = false,exclusive_owner = none,
arguments = [{<<"x-expires">>,signedint,600000}],
pid = <3186.30389.6>,
slave_pids = [<0.19317.1>],
sync_slave_pids = [<0.19317.1>],
down_slave_nodes = [rabbit@rabbitmqNode0],
policy = [{vhost,<<"/">>},
{name,<<"ha_all_queue">>},
{pattern,<<"^">>},
{'apply-to',<<"queues">>},
{definition,[{<<"ha-mode">>,<<"all">>},
{<<"ha-sync-mode">>,<<"automatic">>},
{<<"max-length">>,46600},
{<<"message-ttl">>,46400000}]},
{priority,1}],
gm_pids = [{<0.19318.1>,<0.19317.1>},
{<3186.30392.6>,<3186.30389.6>}],
decorators = [],state = live}}
Why does rabbitmq not reply ack, and the actual message is sent successfully? Is it because gm_pids is empty? What is the role of gm_pids? Does the call stack mean that it has been stuck in deleting the queue? What would cause the queue's gm_pids to be empty? In this case, can there be a solution instead of restarting rabbitmq?
I am using rabbitmq-3.5.6 on erlang-18.3.
Thanks!
--
You received this message because you are subscribed to the Google Groups "rabbitmq-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-user...@googlegroups.com.
To post to this group, send email to rabbitm...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
I'm not sure I understand what the question is. Kombu is a Python client that historically had awful limitationsand poor design choices, e.g. it did not support heartbeats at all [1], which means RabbitMQ was closing connectionson it if they didn't have any activity. So if you have mass client disconnects with Kombu, that's my leading hypothesis.
Avoid Kombu if you can help it; Pika isulator Discarding message {'$gen_call',{<0.17752.2973>,#Ref<0.1372313994.1123287061.26381>},{info,[name,messages,consumers]}} from <0.17752.2973> to <0.18739.20> in an old incarnation (2) of this node (1)
MKStaff Software Engineer, Pivotal/RabbitMQ much better client in almost every way.
--
You received this message because you are subscribed to the Google Groups "rabbitmq-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-user...@googlegroups.com.
To post to this group, send email to rabbitm...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.