try to close failing connection

This commit is contained in:
Tomas Kopecek 2023-02-20 11:48:24 +01:00
parent 22c88fcce3
commit 7cc3fe6a52

View file

@ -76,6 +76,10 @@ class LibvirtCallable(object):
logging.getLogger("koji.vm").warning(
'Internal libvirt error: %s, retry #%d/%d' % (ex, retry, max_retries))
time.sleep(5)
try:
self.conn._conn.close()
except Exception:
pass
self.conn._conn = libvirt.open(None)
else:
raise