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.

NOTE: update n-lib version
The neutron-lib version is bumped to 3.4.2. It contains [1], needed
for this patch.

[1]https://review.opendev.org/c/openstack/neutron-lib/+/903335

Conflicts:
    requirements.txt

Partial-Bug: #2036607
Change-Id: I2aca9a522bda2d69962369748b70fa9270fbe245
(cherry picked from commit bb1114c8b1b99834f2cb782dae796fa778ec2319)
This commit is contained in:
Rodolfo Alonso Hernandez 2023-09-11 17:26:56 +00:00 committed by Bernard Cafarelli
parent 94cf7a4c28
commit 20ba447787
2 changed files with 3 additions and 2 deletions
neutron/plugins/ml2/drivers/ovn/mech_driver
requirements.txt

@ -244,7 +244,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)

@ -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.4.0 # Apache-2.0
neutron-lib>=3.4.2 # Apache-2.0
python-neutronclient>=7.8.0 # Apache-2.0
tenacity>=6.0.0 # Apache-2.0
SQLAlchemy>=1.4.23 # MIT