Merge pull request #69699 from avanthakkar/fix-mgr-recoverdb

mgr: fix MgrModuleRecoverDB to honor its retry budget on db cleanup failure

Reviewed-by: John Mulligan <jmulligan@redhat.com>
Reviewed-by: Kefu Chai <k.chai@proxmox.com>
This commit is contained in:
Kefu Chai 2026-06-27 08:44:47 +08:00 committed by GitHub
commit 4e5fd9ae8b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -619,8 +619,13 @@ def MgrModuleRecoverDB(func: Callable) -> Callable:
if retries > MAX_DBCLEANUP_RETRIES:
raise
self.log.debug("attempting reopen of database")
self.close_db()
self.open_db()
try:
self.close_db()
self.open_db()
except sqlite3.DatabaseError as e2:
self.log.warning(
f"reopen attempt {retries}/{MAX_DBCLEANUP_RETRIES} failed: {e2}"
)
# allow retry of func(...)
check.__signature__ = inspect.signature(func) # type: ignore[attr-defined]
return check