From bb1114c8b1b99834f2cb782dae796fa778ec2319 Mon Sep 17 00:00:00 2001 From: Rodolfo Alonso Hernandez Date: Mon, 11 Sep 2023 17:26:56 +0000 Subject: [PATCH] Make ``OVNMechanismDriver.post_fork_initialize`` callback cancellable If the callback method ``OVNMechanismDriver.post_fork_initialize`` fails, the callback manager must raise an exception and finish the process. If that happens in a Neutron worker, the ``oslo_service.service.Services`` class will restart the process. The neutron-lib version is bumped to 3.9.0. It contains [1], needed for this patch. [1]https://review.opendev.org/c/openstack/neutron-lib/+/895940 Partial-Bug: #2036607 Change-Id: I2aca9a522bda2d69962369748b70fa9270fbe245 --- neutron/plugins/ml2/drivers/ovn/mech_driver/mech_driver.py | 3 ++- requirements.txt | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/neutron/plugins/ml2/drivers/ovn/mech_driver/mech_driver.py b/neutron/plugins/ml2/drivers/ovn/mech_driver/mech_driver.py index 37ea5029226..292df14d47f 100644 --- a/neutron/plugins/ml2/drivers/ovn/mech_driver/mech_driver.py +++ b/neutron/plugins/ml2/drivers/ovn/mech_driver/mech_driver.py @@ -248,7 +248,8 @@ class OVNMechanismDriver(api.MechanismDriver): events.BEFORE_SPAWN) registry.subscribe(self.post_fork_initialize, resources.PROCESS, - events.AFTER_INIT) + events.AFTER_INIT, + cancellable=True) registry.subscribe(self._add_segment_host_mapping_for_segment, resources.SEGMENT, events.AFTER_CREATE) diff --git a/requirements.txt b/requirements.txt index 587045775ba..413a522f2d9 100644 --- a/requirements.txt +++ b/requirements.txt @@ -20,7 +20,7 @@ Jinja2>=2.10 # BSD License (3 clause) keystonemiddleware>=5.1.0 # Apache-2.0 netaddr>=0.7.18 # BSD netifaces>=0.10.4 # MIT -neutron-lib>=3.8.0 # Apache-2.0 +neutron-lib>=3.9.0 # Apache-2.0 python-neutronclient>=7.8.0 # Apache-2.0 tenacity>=6.0.0 # Apache-2.0 SQLAlchemy>=1.4.23 # MIT