Not enough heartbeat frames sent in heartbeat threshold interval
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
oslo.messaging |
Fix Released
|
High
|
Arnaud Morin |
Bug Description
The current rabbitmq driver is not sending enough heartbeat frames in the interval specified in the config.
The default config is:
heartbeat_
heartbeat_rate = 2
As per heartbeat AMQP documentation [1], if two frames are missing in a interval, then the connection should be closed by the broker.
Having heartbeat_
Rabbitmq expects then to receive at least 2 heartbeats in these 60secs (see [2]).
If the two heartbeats are missing, rabbitmq will close the connection.
The current implementation will send a heartbeat frame only every 75 seconds, so the connection will be closed.
Here is why it's every 75 secs:
First, the kombu connection is created with a heartbeat set to:
kombu.connectio
...
heartbeat=
...
)
So, kombu will send heartbeat frames only every 60 secs.
Secondly, to let kombu send the heartbeats correctly, the heartbeat_check needs to be executed every seconds. However, the current implementation is saying:
# NOTE(sileht): 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
# expected 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_
# heartbeat_rate is 2)
So it will wait an extra 60/2/2 = 15 secs before actually sending the frame.
60 + 15 = 75.
[1] https:/
[2] https:/
Changed in oslo.messaging: | |
assignee: | nobody → Arnaud Morin (arnaud-morin) |
importance: | Undecided → High |
Fix proposed to branch: master /review. opendev. org/c/openstack /oslo.messaging /+/875614
Review: https:/