[OVN] Check for lock in check_for_mcast_flood_reports

The maintenance method check_for_mcast_flood_reports() was not checking
if that instance of the maintenance task has a valid lock before trying
to execute a transaction.

This patch adds such check so instances of the maintenance task without
a valid lock will just return.

Change-Id: I791026058b37f06d1a19b5fb6823b9dbb2a3eca5
Closes-Bug: #1927077
Signed-off-by: Lucas Alvares Gomes <lucasagomes@gmail.com>
This commit is contained in:
Lucas Alvares Gomes 2021-05-04 11:33:20 +01:00
parent d6d6855234
commit 317407fe61
1 changed files with 3 additions and 0 deletions

View File

@ -667,6 +667,9 @@ class DBInconsistenciesPeriodics(SchemaAwarePeriodicsBase):
# once per lock due to the use of periodics.NeverAgain().
@periodics.periodic(spacing=600, run_immediately=True)
def check_for_mcast_flood_reports(self):
if not self.has_lock:
return
cmds = []
for port in self._nb_idl.lsp_list().execute(check_error=True):
port_type = port.type.strip()