rabbit: Fix wrong section to render connection pool options

These options are looked up from the [oslo_messaging_rabbit] section.
Fix the wrong section ([DEFAULT]) used when rendering these options by
oslo-config-generator.

Because these options are now specific to RabbitMQ driver, migrate
the definition from base to rabbitmq driver module.

Change-Id: I29db03a775b17dfd11737225b41c7d408727fe88
This commit is contained in:
Takashi Kajinami 2024-12-12 01:11:06 +09:00
parent 0deb682868
commit 5f92d68e94
4 changed files with 8 additions and 19 deletions

View File

@ -16,23 +16,11 @@ import abc
import threading
import uuid
from oslo_config import cfg
from oslo_utils import excutils
from oslo_utils import timeutils
from oslo_messaging import exceptions
base_opts = [
cfg.IntOpt('rpc_conn_pool_size', default=30,
deprecated_group='DEFAULT',
help='Size of RPC connection pool.',
min=1),
cfg.IntOpt('conn_pool_min_size', default=2,
help='The pool size limit for connections expiration policy'),
cfg.IntOpt('conn_pool_ttl', default=1200,
help='The time-to-live in sec of idle connections in the pool')
]
def batch_poll_helper(func):
"""Decorator to poll messages in batch

View File

@ -41,7 +41,6 @@ from oslo_utils import netutils
import oslo_messaging
from oslo_messaging._drivers import amqp as rpc_amqp
from oslo_messaging._drivers import amqpdriver
from oslo_messaging._drivers import base
from oslo_messaging._drivers import common as rpc_common
from oslo_messaging._drivers import pool
from oslo_messaging import _utils
@ -58,6 +57,14 @@ QuorumMemConfig = collections.namedtuple('QuorumMemConfig',
TCP_USER_TIMEOUT = 18
rabbit_opts = [
cfg.IntOpt('rpc_conn_pool_size', default=30,
deprecated_group='DEFAULT',
help='Size of RPC connection pool.',
min=1),
cfg.IntOpt('conn_pool_min_size', default=2,
help='The pool size limit for connections expiration policy'),
cfg.IntOpt('conn_pool_ttl', default=1200,
help='The time-to-live in sec of idle connections in the pool'),
cfg.BoolOpt('ssl',
default=False,
deprecated_name='rabbit_use_ssl',
@ -1766,7 +1773,6 @@ class RabbitDriver(amqpdriver.AMQPDriverBase):
conf.register_group(opt_group)
conf.register_opts(rabbit_opts, group=opt_group)
conf.register_opts(rpc_amqp.amqp_opts, group=opt_group)
conf.register_opts(base.base_opts, group=opt_group)
conf = rpc_common.ConfigOptsProxy(conf, url, opt_group.name)
self.missing_destination_retry_timeout = (

View File

@ -49,9 +49,6 @@ class ConfFixture(fixtures.Fixture):
_import_opts(self.conf,
'oslo_messaging._drivers.impl_rabbit', 'rabbit_opts',
'oslo_messaging_rabbit')
_import_opts(self.conf,
'oslo_messaging._drivers.base', 'base_opts',
'oslo_messaging_rabbit')
_import_opts(self.conf,
'oslo_messaging._drivers.amqp', 'amqp_opts',
'oslo_messaging_rabbit')

View File

@ -16,7 +16,6 @@ import copy
import itertools
from oslo_messaging._drivers import amqp
from oslo_messaging._drivers import base as drivers_base
from oslo_messaging._drivers import impl_rabbit
from oslo_messaging._drivers.kafka_driver import kafka_options
from oslo_messaging.notify import notifier
@ -30,7 +29,6 @@ __all__ = [
]
_global_opt_lists = [
drivers_base.base_opts,
server._pool_opts,
client._client_opts,
transport._transport_opts,