Set the Neutron server workers name

The patch [1] defines the RpcWorker and RpcReportsWorker processes
names. However, the parent class ``neutron_lib.worker.BaseWorker``
init method is not reading the class variable defined in [1]. This
patch is explictly passing the ``desc`` class name in the init method.

[1]https://review.opendev.org/c/openstack/neutron/+/907712

Closes-Bug: #2069581
Change-Id: I50c2b0567ea10316ad06e6e6c1d01db8b9520e3e
This commit is contained in:
Rodolfo Alonso Hernandez 2024-06-17 10:24:44 +00:00
parent 0c4793ed2a
commit cabe18dd79
3 changed files with 11 additions and 4 deletions

View File

@ -18,8 +18,12 @@ from neutron.common import config
class MaintenanceWorker(worker.BaseWorker):
desc = 'maintenance worker'
def start(self):
def __init__(self, **kwargs):
super().__init__(desc=self.desc, **kwargs)
def start(self, **kwargs):
super(MaintenanceWorker, self).start()
# NOTE(twilson) The super class will trigger the post_fork_initialize
# in the driver, which starts the connection/IDL notify loop which

View File

@ -100,7 +100,8 @@ class RpcWorker(neutron_worker.NeutronBaseWorker):
def __init__(self, plugins, worker_process_count=1):
super(RpcWorker, self).__init__(
worker_process_count=worker_process_count
worker_process_count=worker_process_count,
desc=self.desc,
)
self._plugins = plugins

View File

@ -17,11 +17,13 @@ from oslo_service import loopingcall
class NeutronBaseWorker(worker.BaseWorker):
def __init__(self, worker_process_count=1, set_proctitle=None):
def __init__(self, worker_process_count=1, set_proctitle=None,
desc=None):
set_proctitle = set_proctitle or cfg.CONF.setproctitle
super(NeutronBaseWorker, self).__init__(
worker_process_count=worker_process_count,
set_proctitle=set_proctitle
set_proctitle=set_proctitle,
desc=desc,
)
def start(self, name="neutron-server", desc=None):