Move the `ProcessMonitor initialization to the Service.start` phase

This issue is similar to what was fixed in [1]. In this case, the
process monitor instance needs to be instantiated after the L3 agent
service has been launched and forked.

This patch must work both with the current ``oslo.service`` backend
(eventlet) and the new implementation (threading) [3], already
released.

[1]https://review.opendev.org/c/openstack/neutron/+/949135
[2]https://review.opendev.org/c/openstack/oslo.service/+/945720

Closes-Bug: #2114176
Change-Id: I6e5406a0a3846aaf52171edb46dfb29332b938ff
This commit is contained in:
Rodolfo Alonso Hernandez
2025-06-12 12:42:33 +00:00
parent 7c478bad67
commit 4b2625adb9

View File

@ -271,10 +271,7 @@ class L3NATAgent(ha.AgentMixin,
self._check_config_params()
self.process_monitor = external_process.ProcessMonitor(
config=self.conf,
resource_type='router')
self.process_monitor = None
self._context = n_context.get_admin_context_without_session()
self.target_ex_net_id = None
@ -286,6 +283,9 @@ class L3NATAgent(ha.AgentMixin,
def init_host(self):
super().init_host()
self.process_monitor = external_process.ProcessMonitor(
config=self.conf,
resource_type='router')
self.plugin_rpc = L3PluginApi(topics.L3PLUGIN, self.host)
self.driver = common_utils.load_interface_driver(
self.conf,