Introduce the new rabbit_heartbeat_in_pthread option

oslo.messaging RabbitMQ driver have now a new option that allow user to
run the RabbitMQ heartbeat over a native python thread.

These change allow user to use this new option.

Change-Id: Ia2e54453058080f12963dedb18249faa5c9b2424
Closes-Bug: #1840868
This commit is contained in:
ZhongShengping 2019-08-21 14:21:01 +08:00
parent d69c2831b4
commit 818193f578
4 changed files with 24 additions and 3 deletions

View File

@ -152,6 +152,7 @@ trove::control_exchange instead.")
oslo::messaging::rabbit {'trove_guestagent_config':
rabbit_use_ssl => $rabbit_use_ssl,
rabbit_ha_queues => $::trove::rabbit_ha_queues,
heartbeat_in_pthread => $::trove::rabbit_heartbeat_in_pthread,
kombu_reconnect_delay => $::trove::kombu_reconnect_delay,
kombu_failover_strategy => $::trove::kombu_failover_strategy,
amqp_durable_queues => $::trove::amqp_durable_queues,

View File

@ -73,6 +73,16 @@
# (optional) Use HA queues in RabbitMQ (x-ha-policy: all).
# Defaults to $::os_service_default
#
# [*rabbit_heartbeat_in_pthread*]
# (Optional) EXPERIMENTAL: Run the health check heartbeat thread
# through a native python thread. By default if this
# option isn't provided the health check heartbeat will
# inherit the execution model from the parent process. By
# example if the parent process have monkey patched the
# stdlib by using eventlet/greenlet then the heartbeat
# will be run through a green thread.
# Defaults to $::os_service_default
#
# [*kombu_reconnect_delay*]
# (optional) How long to wait before reconnecting in response to an AMQP
# consumer cancel notification.
@ -293,6 +303,7 @@ class trove(
$rabbit_use_ssl = $::os_service_default,
$rabbit_ha_queues = $::os_service_default,
$rabbit_notification_topic = $::os_service_default,
$rabbit_heartbeat_in_pthread = $::os_service_default,
$kombu_ssl_ca_certs = $::os_service_default,
$kombu_ssl_certfile = $::os_service_default,
$kombu_ssl_keyfile = $::os_service_default,

View File

@ -0,0 +1,6 @@
---
features:
- |
Allow users to run the RabbitMQ heartbeat over a native python thread in the
oslo.messaging RabbitMQ driver, by using the `rabbit_heartbeat_in_pthread`
option in configuration.

View File

@ -41,6 +41,7 @@ describe 'trove::guestagent' do
is_expected.to contain_trove_guestagent_config('oslo_messaging_rabbit/kombu_reconnect_delay').with_value('<SERVICE DEFAULT>')
is_expected.to contain_trove_guestagent_config('oslo_messaging_rabbit/kombu_failover_strategy').with_value('<SERVICE DEFAULT>')
is_expected.to contain_trove_guestagent_config('oslo_messaging_rabbit/amqp_durable_queues').with_value('<SERVICE DEFAULT>')
is_expected.to contain_trove_guestagent_config('oslo_messaging_rabbit/heartbeat_in_pthread').with_value('<SERVICE DEFAULT>')
is_expected.to contain_trove_guestagent_config('DEFAULT/swift_url').with_value('<SERVICE DEFAULT>')
is_expected.to contain_trove_guestagent_config('DEFAULT/swift_service_type').with_value('<SERVICE DEFAULT>')
is_expected.to contain_trove_guestagent_config('DEFAULT/root_grant').with_value('<SERVICE DEFAULT>')
@ -73,13 +74,15 @@ describe 'trove::guestagent' do
context 'when using a single RabbitMQ server with enable ha options' do
let :pre_condition do
"class { 'trove':
nova_proxy_admin_pass => 'verysecrete',
rabbit_ha_queues => 'true',
amqp_durable_queues => 'true',
nova_proxy_admin_pass => 'verysecrete',
rabbit_ha_queues => 'true',
rabbit_heartbeat_in_pthread => 'true',
amqp_durable_queues => 'true',
}"
end
it 'configures trove-api with RabbitMQ' do
is_expected.to contain_trove_guestagent_config('oslo_messaging_rabbit/rabbit_ha_queues').with_value('true')
is_expected.to contain_trove_guestagent_config('oslo_messaging_rabbit/heartbeat_in_pthread').with_value('true')
is_expected.to contain_trove_guestagent_config('oslo_messaging_rabbit/amqp_durable_queues').with_value('true')
end
end