-
Notifications
You must be signed in to change notification settings - Fork 23
Look into AMQP/RabbitMQ heartbeat #1411
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
If we set heartbeat to a low value, it could cause problems during slow downloads. The py-amqp library documentation recommends calling |
I think you already know this, but just clarifying... there are two settings:
I dunno if we even need a setting. I guess we could try to figure out a setting that works |
That's a good point, and I didn't understand why they recommended calling But I just re-read the documentation and looked at the code and I think it makes sense now. https://docs.celeryq.dev/projects/amqp/en/latest/_modules/amqp/connection.html#Connection.heartbeat_tick If we want to manage timing of the heartbeat packets, we can use the RabbitMQ uses a default value of 60 seconds, and RabbitMQ maintained AMQP libraries (Java, .NET and Erlang) negotiate a heartbeat value based on the server's suggestion and the client's preference: https://www.rabbitmq.com/docs/heartbeats#heartbeats-timeout But it's not super uncommon for file transfer to take >60 seconds, so I think that would be too low as a default unless we re-work the transfer code to allow housekeeping (or another mechanism to trigger the heartbeat) to run in the middle of a download. Maybe a good start would be calculating the heartbeat interval from the existing timeout setting? |
so like currently... the algorithm processes stuff a batch at a time. Maybe this means we should put ack inside the action phase, so that traffic on the message bus occurs between each transfer instead of only after all the transfers in the batch have been attempted. |
It seems like the AMQP library we are using defaults to setting the heartbeat value to 0.
This means that the RabbitMQ broker doesn't detect when a connection has been broken. The sarra client reconnects itself on a new connection, but the old one seems to get left behind on the server.
https://www.rabbitmq.com/docs/heartbeats
https://docs.celeryq.dev/projects/amqp/en/latest/#:~:text=Support%20for%20heartbeats,Connection.send_heartbeat.
The text was updated successfully, but these errors were encountered: