mosquito / aio-pika

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

`Channel closed` publishing errors are raised after reconnection with restarted rabbitmq instance in versions > `8.2.3` #534

Open ancalita opened 1 year ago

ancalita commented 1 year ago

In versions above 8.2.3 (starting with 8.2.4), whenever the RabbitMQ server is restarted and the publisher (in this case an instance of Rasa assistant) attempts to publish new messages, we've encountered publishing failures due to e.g. '<Channel: "1" at 0x1382a4a40> closed errors. This can be reproduced with 8.2.4 and 8.3.0 too. I have not tried with 9.0.x (currently the aio-pika dependency is pinned <9.0.0 in rasa). This kind of error is not encountered after restarts with version 8.2.3 for example.

mosquito commented 1 year ago

@ancalita The problem was at the intersection of aiormq and aio_pika, and was almost completely fixed in branch 9. Backporting this to branch 8, I don't have the resources, sorry. The best recommendation I can give you is to migrate to version 9.

ancalita commented 1 year ago

@mosquito Thanks! Temporarily we've pinned to 8.2.3 until we have the bandwidth to upgrade to the new major version and resolve any breaking changes. Which version 9.x specifically contains the fix to this restart bug?

mosquito commented 1 year ago

@ancalita the 9.0.5 is really better with it. But the latest bulk of fixes in #533