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 <libosvar@redhat.com>
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user