From 6efa45e2bdc3d478eead0b8d7b179c2ed49f9841 Mon Sep 17 00:00:00 2001 From: Andrew Bonney Date: Fri, 11 Mar 2022 09:29:23 +0000 Subject: [PATCH] Add configuration option for heartbeat_in_pthread This configuration option has been observed to result in file descriptor leaks in certain circumstances. A variable is added here so that it can be easily overridden. Related-Bug: #1961603 Change-Id: I8155264b181d6f21728804ef8260979931597427 --- defaults/main.yml | 3 +++ .../notes/heartbeat-in-pthread-d0c9958361c224f0.yaml | 5 +++++ templates/cinder.conf.j2 | 3 +++ vars/main.yml | 2 ++ 4 files changed, 13 insertions(+) create mode 100644 releasenotes/notes/heartbeat-in-pthread-d0c9958361c224f0.yaml diff --git a/defaults/main.yml b/defaults/main.yml index c38426a4..e8ae6401 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -77,6 +77,9 @@ cinder_db_connection_recycle_time: "{{ openstack_db_connection_recycle_time | de ## Oslo Messaging +# RabbitMQ +cinder_oslomsg_heartbeat_in_pthread: "{{ oslomsg_heartbeat_in_pthread | default(_cinder_oslomsg_heartbeat_in_pthread) }}" + # RPC cinder_oslomsg_rpc_host_group: "{{ oslomsg_rpc_host_group | default('rabbitmq_all') }}" cinder_oslomsg_rpc_setup_host: "{{ (cinder_oslomsg_rpc_host_group in groups) | ternary(groups[cinder_oslomsg_rpc_host_group][0], 'localhost') }}" diff --git a/releasenotes/notes/heartbeat-in-pthread-d0c9958361c224f0.yaml b/releasenotes/notes/heartbeat-in-pthread-d0c9958361c224f0.yaml new file mode 100644 index 00000000..3782fda0 --- /dev/null +++ b/releasenotes/notes/heartbeat-in-pthread-d0c9958361c224f0.yaml @@ -0,0 +1,5 @@ +--- +fixes: + - | + Fixes a file descriptor leak which may impact services which use the + oslo.messaging RabbitMQ heartbeat mechanism. diff --git a/templates/cinder.conf.j2 b/templates/cinder.conf.j2 index 2581eba2..a7c550c8 100644 --- a/templates/cinder.conf.j2 +++ b/templates/cinder.conf.j2 @@ -121,6 +121,9 @@ max_pool_size = {{ cinder_db_max_pool_size }} pool_timeout = {{ cinder_db_pool_timeout }} connection_recycle_time = {{ cinder_db_connection_recycle_time }} +[oslo_messaging_rabbit] +heartbeat_in_pthread = {{ cinder_oslomsg_heartbeat_in_pthread }} + [oslo_messaging_notifications] driver = {{ (cinder_ceilometer_enabled | bool) | ternary('messagingv2', 'noop') }} transport_url = {{ cinder_oslomsg_notify_transport }}://{% for host in cinder_oslomsg_notify_servers.split(',') %}{{ cinder_oslomsg_notify_userid }}:{{ cinder_oslomsg_notify_password }}@{{ host }}:{{ cinder_oslomsg_notify_port }}{% if not loop.last %},{% else %}/{{ cinder_oslomsg_notify_vhost }}{% if cinder_oslomsg_notify_use_ssl | bool %}?ssl=1&ssl_version={{ cinder_oslomsg_notify_ssl_version }}&ssl_ca_file={{ cinder_oslomsg_notify_ssl_ca_file }}{% else %}?ssl=0{% endif %}{% endif %}{% endfor %} diff --git a/vars/main.yml b/vars/main.yml index 9338fc8a..becd5e7b 100644 --- a/vars/main.yml +++ b/vars/main.yml @@ -119,3 +119,5 @@ cinder_service_catalog: type: "{{ cinder_service_v3_type }}" description: "{{ cinder_service_v3_description }}" state: present + +_cinder_oslomsg_heartbeat_in_pthread: "{{ (cinder_services['cinder-volume']['group'] in group_names) | ternary(False, True) }}"