Closed nickgerace closed 7 months ago
Hello. I think I found the problem.
Code below spawning task that send heartbeats: https://github.com/rabbitmq/rabbitmq-stream-rust-client/blob/7db8d4506dab0079680d7728b90765ae0d3806f1/src/client/mod.rs#L622
The problem is that the first heartbeat may be sent before the Tunes command. As far as I understand, this breaks the connection protocol and closes the RabbitMQ connection.
There are also several different problems that lead to infinity hangs. I will try to create PR with more information soon
PR #213 trying to fix two problems:
Sending a Heartbeat before the Tunes command (and Open command) disrupts the connection protocol, leading RabbitMQ to terminate the connection.
The client incorrectly manages the loss of connection. Requests continue to await a response indefinitely.
Thank you so much @alfredotg! Good catch :exploding_head:
Describe the bug
It appears to be random as to when it happens, but when running RabbitMQ with Streams on macOS aarch64 via Docker and using this library, there is sometimes an infinite hang. This is never seen on my Linux systems.
The container logs the following message:
I'm unsure if the client is causing the hang or the RabbitMQ instance is failing, but either way an infinite hang occurs and the client does not handle it.
Reproduction steps
rabbitmq/3.12-management-alpine
, publish port5552:5552
, enable therabbitmq_stream
plugin, and run with argsRABBITMQ_SERVER_ADDITIONAL_ERL_ARGS=-rabbitmq_stream advertised_host localhost"
)Invalid transition from tuned to tuned.
Expected behavior
I expected the client to either not cause the hang or at least retain a responsive state and handle the hang/error from the RabbitMQ instance.
Additional context
No response