-
Notifications
You must be signed in to change notification settings - Fork 194
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
Send heartbeat frames more often #405
Conversation
From my POV there is a main issue in the library implementation. The current implementation is mixing heartbeat (the interval between two tick) and the heartbeat timeout on amqp connection. Lines 441 to 445 in 9d7b36a
As written in rabbitmq documentation "It is important to not confuse the timeout value with the interval one". The amqp connection should be open with the heartbeat timeout taking care of timeout negotiation with server and then send a tick every heartbeat interval. Technically it is enough to get the heartbeat timeout and the heartbeat rate to compute the heartbeat interval. |
Units are green on my side, is there anything wrong in the github actions? |
I restarted |
up |
recheck |
@arnaudmorin I would like to know your POV on this |
I agree with what Pierre Samuel is explaining, but refactoring this would lead to an API change (the parameter would be renamed / reconfigured), and I dont think this is something we want on py-amqp now. Eventually this could be done in another change. |
can you please try to change the rabbitmq docker image to fix the integration test? |
lets see how this #414 go |
you can rebase now |
This small change in tox.ini allow giving pytests extra arguments, for e.g. tox -e pypy-39-unit -- -k test_heartbeat_check_rate_ -s which allow running only part of the tests (useful for debug purpose). Signed-off-by: Arnaud Morin <arnaud.morin@ovhcloud.com> Change-Id: I535acdb918c6caaae6e6ea4596437076a38f7a59
The AMQP protocol is saying that we should send "two" "heartbeat frames" during the "heartbeat timeout" (see [1] and rabbit implement this in [2]). The "two" value is the "rate" parameter in the current implementation. The current implementation was sending only one frame during the "heartbeat timeout", which is wrong. [1] https://www.amqp.org/specification/0-9-1/amqp-org-download [2] https://www.rabbitmq.com/heartbeats.html#heartbeats-interval Signed-off-by: Arnaud Morin <arnaud.morin@ovhcloud.com>
The AMQP protocol is saying that we should send "two" "heartbeat frames" during the "heartbeat timeout" (see [1] and rabbit implement this in [2]).
The "two" value is the "rate" parameter in the current implementation.
The current implementation was sending only one frame during the "heartbeat timeout", which is wrong.
[1] https://www.amqp.org/specification/0-9-1/amqp-org-download
[2] https://www.rabbitmq.com/heartbeats.html#heartbeats-interval