oslo.messaging/oslo_messaging
Arnaud Morin 36fb5bceab Set default heartbeat_rate to 3
Kombu recommend to run heartbeat_check every seconds but we use a lock
around the kombu connection so, to not lock to much this lock to most of
the time do nothing except waiting the events drain, we start
heartbeat_check and retrieve the server heartbeat packet only two times
more than the minimum required for the heartbeat works:
    heartbeat_timeout / heartbeat_rate / 2.0

Because of this, we are not sending the heartbeat frames at correct
intervals. E.G.

If heartbeat_timeout=60 and rate=2, AMQP protocol expects to send a
frame
every 30sec.

With the current heartbeat_check implementation, heartbeat_check will be
called every:
    heartbeat_timeout / heartbeat_rate / 2.0 = 60 / 2 / 2.0 = 15
Which will result in the following frame flow:
    T+0  --> do nothing (60/2 > 0)
    T+15 --> do nothing (60/2 > 15)
    T+30 --> do nothing (60/2 > 30)
    T+45 --> send a frame (60/2 < 45)
    ...

With heartbeat_rate=3, the heartbeat_check will be executed more often:
    heartbeat_timeout / heartbeat_rate / 2.0 = 60 / 3 / 2.0 = 10
Frame flow:
    T+0  --> do nothing (60/3 > 0)
    T+10 --> do nothing (60/3 > 10)
    T+20 --> do nothing (60/3 > 20)
    T+30 --> send a frame (60/3 < 30)
    ...

Now we are sending the frame with correct intervals

Closes-bug: #2008734

Signed-off-by: Arnaud Morin <arnaud.morin@ovhcloud.com>
Change-Id: Ie646d254faf5e45ba46948212f4c9baf1ba7a1a8
2023-08-08 15:23:59 +02:00
..
_drivers Set default heartbeat_rate to 3 2023-08-08 15:23:59 +02:00
_metrics Add Support For oslo.metrics 2021-06-08 22:22:37 +08:00
hacking Remove six usage 2020-05-11 10:21:58 +02:00
notify [rabbit] use retry parameters during notification sending 2022-01-12 12:22:55 +01:00
rpc Support overriding class for get_rpc_* helper functions 2023-01-23 08:40:37 +00:00
tests Merge "Remove logging from ProducerConnection._produce_message" 2022-12-21 07:46:22 +00:00
__init__.py Remove deprecated localcontext 2016-05-18 09:28:15 +02:00
_utils.py Disable greenthreads for RabbitDriver "listen" connections 2023-03-03 11:24:27 +01:00
conffixture.py Add Support For oslo.metrics 2021-06-08 22:22:37 +08:00
dispatcher.py Remove six usage 2020-05-11 10:21:58 +02:00
exceptions.py Add a new option to enforce the OpenSSL FIPS mode 2021-11-08 15:05:30 +01:00
opts.py Add a ping endpoint to RPC dispatcher 2020-08-18 15:09:29 +02:00
serializer.py Remove six usage 2020-05-11 10:21:58 +02:00
server.py Remove six usage 2020-05-11 10:21:58 +02:00
target.py Fixups to the inline documentation 2016-09-12 09:49:00 -04:00
transport.py Remove six usage 2020-05-11 10:21:58 +02:00
version.py pbr.version.VersionInfo needs package name (oslo.xyz and not oslo_xyz) 2017-02-06 12:49:23 -05:00