upstream/openstack/python-oslo-messaging/centos/patches/rabbit-increase-heartbeat-rate-to-decrease-poll-interval.patch
Dean Troyer 9d3ca49387 StarlingX open source release updates
Signed-off-by: Dean Troyer <dtroyer@gmail.com>
2018-05-31 07:37:19 -07:00

38 lines
1.4 KiB
Diff

From c5cc972c692d3fc05afc54d0368511e7699d241f Mon Sep 17 00:00:00 2001
From: rpm-build <rpm-build>
Date: Fri, 2 Jun 2017 14:52:44 -0400
Subject: [PATCH] rabbit: increase heartbeat rate to decrease poll interval
The poll_timeout is tied to the heartbeat_rate value when the
heartbeat_timeout_threshold is non-zero. It works out to be:
threshold / rate / 2
Therefore the default is 60 / 2 / 2 = 15. This causes the recv() to block for
up to 15 seconds unless there are incoming RPC messages. This is problematic
for graceful shutdown of services as the stop() request may block if the recv()
is blocked. To ensure that the recv() does not block for a long time we are
reducing the interval by controlling the rate.
Signed-off-by: rpm-build <rpm-build>
---
oslo_messaging/_drivers/impl_rabbit.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/oslo_messaging/_drivers/impl_rabbit.py b/oslo_messaging/_drivers/impl_rabbit.py
index da1acee..eeb9257 100644
--- a/oslo_messaging/_drivers/impl_rabbit.py
+++ b/oslo_messaging/_drivers/impl_rabbit.py
@@ -191,7 +191,7 @@ rabbit_opts = [
"considered down if heartbeat's keep-alive fails "
"(0 disable the heartbeat). EXPERIMENTAL"),
cfg.IntOpt('heartbeat_rate',
- default=2,
+ default=10,
help='How often times during the heartbeat_timeout_threshold '
'we check the heartbeat.'),
--
2.12.1