Fix ignored rabbit_heartbeat_in_pthread

... and adds support for a few more heartbeat options.

Change-Id: Id5c84897cea25de95b5382cd2b6b9719e2cc9892
This commit is contained in:
Takashi Kajinami 2023-09-15 10:59:45 +09:00
parent 9974cdd4a2
commit 3504c344c0
3 changed files with 103 additions and 69 deletions

View File

@ -73,6 +73,21 @@
# (optional) Use HA queues in RabbitMQ (x-ha-policy: all). # (optional) Use HA queues in RabbitMQ (x-ha-policy: all).
# Defaults to $facts['os_service_default'] # Defaults to $facts['os_service_default']
# #
# [*rabbit_heartbeat_timeout_threshold*]
# (optional) Number of seconds after which the RabbitMQ broker is considered
# down if the heartbeat keepalive fails. Any value >0 enables heartbeats.
# Heartbeating helps to ensure the TCP connection to RabbitMQ isn't silently
# closed, resulting in missed or lost messages from the queue.
# (Requires kombu >= 3.0.7 and amqp >= 1.4.0)
# Defaults to $facts['os_service_default']
#
# [*rabbit_heartbeat_rate*]
# (optional) How often during the rabbit_heartbeat_timeout_threshold period to
# check the heartbeat on RabbitMQ connection. (i.e. rabbit_heartbeat_rate=2
# when rabbit_heartbeat_timeout_threshold=60, the heartbeat will be checked
# every 30 seconds.
# Defaults to $facts['os_service_default']
#
# [*rabbit_heartbeat_in_pthread*] # [*rabbit_heartbeat_in_pthread*]
# (Optional) EXPERIMENTAL: Run the health check heartbeat thread # (Optional) EXPERIMENTAL: Run the health check heartbeat thread
# through a native python thread. By default if this # through a native python thread. By default if this
@ -251,6 +266,8 @@ class trove(
$rabbit_use_ssl = $facts['os_service_default'], $rabbit_use_ssl = $facts['os_service_default'],
$rabbit_ha_queues = $facts['os_service_default'], $rabbit_ha_queues = $facts['os_service_default'],
$rabbit_notification_topic = $facts['os_service_default'], $rabbit_notification_topic = $facts['os_service_default'],
$rabbit_heartbeat_timeout_threshold = $facts['os_service_default'],
$rabbit_heartbeat_rate = $facts['os_service_default'],
$rabbit_heartbeat_in_pthread = $facts['os_service_default'], $rabbit_heartbeat_in_pthread = $facts['os_service_default'],
$kombu_ssl_ca_certs = $facts['os_service_default'], $kombu_ssl_ca_certs = $facts['os_service_default'],
$kombu_ssl_certfile = $facts['os_service_default'], $kombu_ssl_certfile = $facts['os_service_default'],
@ -370,6 +387,9 @@ class trove(
oslo::messaging::rabbit { 'trove_config': oslo::messaging::rabbit { 'trove_config':
rabbit_ha_queues => $rabbit_ha_queues, rabbit_ha_queues => $rabbit_ha_queues,
heartbeat_timeout_threshold => $rabbit_heartbeat_timeout_threshold,
heartbeat_rate => $rabbit_heartbeat_rate,
heartbeat_in_pthread => $rabbit_heartbeat_in_pthread,
rabbit_use_ssl => $rabbit_use_ssl, rabbit_use_ssl => $rabbit_use_ssl,
kombu_reconnect_delay => $kombu_reconnect_delay, kombu_reconnect_delay => $kombu_reconnect_delay,
kombu_failover_strategy => $kombu_failover_strategy, kombu_failover_strategy => $kombu_failover_strategy,

View File

@ -0,0 +1,11 @@
---
features:
- |
The following parameters have been added to the ``trove`` class.
- ``rabbit_heartbeat_timeout_threshold``
- ``rabbit_heartbeat_rate``
fixes:
- |
Fixed the ignored ``rabbitmq::rabbit_heartbeat_in_pthread`` parameter.

View File

@ -54,6 +54,9 @@ describe 'trove' do
) )
is_expected.to contain_oslo__messaging__rabbit('trove_config').with( is_expected.to contain_oslo__messaging__rabbit('trove_config').with(
:rabbit_ha_queues => '<SERVICE DEFAULT>', :rabbit_ha_queues => '<SERVICE DEFAULT>',
:heartbeat_timeout_threshold => '<SERVICE DEFAULT>',
:heartbeat_rate => '<SERVICE DEFAULT>',
:heartbeat_in_pthread => '<SERVICE DEFAULT>',
:rabbit_use_ssl => '<SERVICE DEFAULT>', :rabbit_use_ssl => '<SERVICE DEFAULT>',
:kombu_reconnect_delay => '<SERVICE DEFAULT>', :kombu_reconnect_delay => '<SERVICE DEFAULT>',
:kombu_failover_strategy => '<SERVICE DEFAULT>', :kombu_failover_strategy => '<SERVICE DEFAULT>',