From 43f4d70ad206aa1e6b8a1f7fd814dae8de515296 Mon Sep 17 00:00:00 2001 From: Fabricio Henrique Ramos Date: Mon, 4 Oct 2021 11:36:08 -0300 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. --- 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 45a49645..bda6f0f9 100644 --- a/oslo_messaging/_drivers/impl_rabbit.py +++ b/oslo_messaging/_drivers/impl_rabbit.py @@ -164,7 +164,7 @@ rabbit_opts = [ "considered down if heartbeat's keep-alive fails " "(0 disables heartbeat)."), cfg.IntOpt('heartbeat_rate', - default=2, + default=10, help='How often times during the heartbeat_timeout_threshold ' 'we check the heartbeat.'), cfg.BoolOpt('direct_mandatory_flag', -- 2.17.1