An error occurred that caused the program to hang

92 views
Skip to first unread message

钮振江

unread,
Jun 15, 2023, 10:02:25 PM6/15/23
to Pika
[2023-06-15 10:57:58,688] [CRITICAL] connection.py:1615 - Received METHOD frame for unregistered channel 1 on <SelectConnection OPEN transport=<pika.adapters.utils.io_services_utils._AsyncPlaintextTransport object at 0x7f0021089f10> params=<ConnectionParameters host=172.172.10.1 port=5672 virtual_host=/ ssl=False>>


What causes this? Can someone please explain?

code show as below


微信图片_20230616100210.png

钮振江

unread,
Jun 16, 2023, 3:25:55 AM6/16/23
to Pika
By the way, my consumer spends more than half an hour. Is there a problem with this? How to solve it?

Terry Rinck

unread,
Jun 16, 2023, 12:02:34 PM6/16/23
to pika-...@googlegroups.com
If you don't put the processing of messages on a separate thread (and ensure the thread safety of acknowledgements) the blocking connection will cause a heartbeat timeout if your consumer takes that long. Look into using the SelectConnection.

--
You received this message because you are subscribed to the Google Groups "Pika" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pika-python...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pika-python/c1772932-7cc0-4b74-9f53-9ec5872a1497n%40googlegroups.com.

钮振江

unread,
Jun 25, 2023, 4:34:35 AM6/25/23
to Pika

Sorry for taking so long to see the reply. The reason for the problem you mentioned is the heartbeat timeout, but I have set the heartbeat timeout to be disabled in my code. Will this still trigger the heartbeat timeout problem? grateful!

钮振江

unread,
Jun 25, 2023, 4:56:50 AM6/25/23
to Pika
Just now, I found an interesting question:
I have a consumer who is consuming a piece of information, and the consumption time reaches about 1 hour. Then I observe that the channel on the web management interface is deleted and a new one is re-established, which leads to an error in my subsequent message confirmation. The reason is that the channel is not the original channel, how can I solve this problem?

钮振江

unread,
Jun 25, 2023, 5:11:29 AM6/25/23
to Pika
I checked the logs of rabbitmq in docker, and finally I found this error, is it caused by this error? How can I solve it? Thanks!

微信图片_20230625171017.png

Luke Bakken

unread,
Jun 27, 2023, 9:46:23 AM6/27/23
to Pika
Hello,

Your consumer is taking far too long to ack the message. You can adjust the value that RabbitMQ uses, see this guide:

钮振江

unread,
Jun 27, 2023, 8:12:40 PM6/27/23
to Pika

thanks, This solution solves my current problem
Reply all
Reply to author
Forward
0 new messages