mosquito / aio-pika

AMQP 0.9 client designed for asyncio and humans.
https://aio-pika.readthedocs.org/
Apache License 2.0
1.18k stars 186 forks source link

Server connection xxx was stuck. No frames were received in 183 seconds. #620

Closed lin-goo closed 4 months ago

lin-goo commented 4 months ago

aio-pika==9.4.0 aiormq== 6.8.0 RabbitMQ==3.12.9, remote cluster

Related issues: https://github.com/mosquito/aio-pika/issues/588 https://github.com/mosquito/aio-pika/issues/577 https://github.com/mosquito/aio-pika/issues/563

After period of inactivity we observed an error in logs:

__reader:668 Server connection <Connection: "amqp://***" at 0x7f33de026580> was stuck. No frames were received in 183 seconds.

This error is logged in the log and manifests itself as an exception:

the publisher still worked so new messages were building up in the queue while the consumers didn't do anything despite being connected.

What should be done to solve this problem?

lin-goo commented 4 months ago

This can be solved by using aio_pika.robust_connection.connect_robust

issue code connect_robust