From 8e47490f7dcfe85ebf57acda354ca0a2edad34e1 Mon Sep 17 00:00:00 2001 From: Jakub Libosvar Date: Tue, 5 Nov 2024 21:37:31 +0000 Subject: [PATCH] OVN metadata agent additional_chassis detection The patch changes how additional_chassis column support is handled in events. We cannot call to IDL from the match methods because the post fork event might not be set yet right after IDL was instantiated. If between the IDL instantiation and the post fork event set an event calling to IDL is processed, the match event method will wait indefinitely. This patch removes the call to IDL in the match method. Closes-Bug: #2086740 Change-Id: Ibc7d9b4dd196bed65cff73b79d78122f70aac1a7 Signed-off-by: Jakub Libosvar (cherry picked from commit d8884a99e03533533f7bacef598e9a6af592e3fa) --- neutron/agent/ovn/metadata/agent.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/neutron/agent/ovn/metadata/agent.py b/neutron/agent/ovn/metadata/agent.py index f8eb56d0c19..afa9f725aa9 100644 --- a/neutron/agent/ovn/metadata/agent.py +++ b/neutron/agent/ovn/metadata/agent.py @@ -69,10 +69,12 @@ def _sync_lock(f): return wrapped +# TODO(jlibosva): Remove the decorator after we depend on OVN version that has +# the schema containing the additional_chassis column def _match_only_if_additional_chassis_is_supported(f): @functools.wraps(f) def wrapped(self, row, old): - if not ovn_utils.is_additional_chassis_supported(self.agent.sb_idl): + if not hasattr(row, 'additional_chassis'): return False return f(self, row, old) return wrapped @@ -204,7 +206,9 @@ class PortBindingUpdatedEvent(PortBindingEvent): def _is_new_chassis_set(self, row, old): self._log_msg = "Port %s in datapath %s bound to our chassis" try: - if ovn_utils.is_additional_chassis_supported(self.agent.sb_idl): + # TODO(jlibosva): Remove the check after we depend on OVN version + # that has the schema containing the additional_chassis column + if hasattr(row, 'additional_chassis'): try: # If the additional chassis used to be in the old version # the resources are already provisioned