Closed sfran96 closed 1 month ago
@sfran96 thx for such detail report! Indeed, seems like the problem on aio-pika side: I reported Issue and pinged Mosquito already. Also I am planning to help him with a fix, when we discuss, how the problem should be fixed. Wait a bit for it, please
Should be closed with tomorrow aio-pika release
AioPika fix was released today v9.4.3
Describe the bug If an application uses a
RabbitBroker
broker to publish messages, the application establishes the connection correctly but after the fact the connection is lost (e.g., broker goes offline) the publishing logic hangs for as long as the broker is offline and then attempts to publish all stuck messages at once.How to reproduce Follow the instructions in the code snippet.
Expected behavior When publishing, if the connection is in an invalid state, the operation fails fast raising some sort of exception.
Observed behavior When publishing, if the connections is lost after its established correctly, the operation hangs forever.
Environment
Additional context This looks like its linked to an open issue with
aio-pika
that could be the source of this one, because a check to the connection's state prior to publishing mitigates the issue, i.e.,if broker._connection.connected.is_set() is False
.