Merge "Fix leaked file descriptors by cleaning up objects" into stable/victoria

This commit is contained in:
Zuul 2021-01-14 14:24:16 +00:00 committed by Gerrit Code Review
commit 175ce9f932
2 changed files with 6 additions and 4 deletions

View File

@ -116,6 +116,7 @@ class OvnProviderHelper(object):
self.requests.put({'type': ovn_const.REQ_TYPE_EXIT})
self.helper_thread.join()
self.ovn_nbdb.stop()
del self.ovn_nbdb_api
@staticmethod
def _map_val(row, col, key):

View File

@ -175,10 +175,11 @@ class OvnNbIdlForLb(ovsdb_monitor.OvnIdl):
def stop(self):
# Close the running connection if it has been initalized
if ((hasattr(self, 'conn') and not
self.conn.stop(timeout=config.get_ovn_ovsdb_timeout()))):
LOG.debug("Connection terminated to OvnNb "
"but a thread is still alive")
if hasattr(self, 'conn'):
if not self.conn.stop(timeout=config.get_ovn_ovsdb_timeout()):
LOG.debug("Connection terminated to OvnNb "
"but a thread is still alive")
del self.conn
# complete the shutdown for the event handler
self.notify_handler.shutdown()
# Close the idl session