fix(state): tolerate closed WAL scan descriptors

(cherry picked from commit 299f91bb0c235cd002510034f77c2e627b3985e6)
This commit is contained in:
KoNit-K
2026-09-14 04:04:30 +08:00
committed by kshitij
parent f9ea3a5328
commit 106bf99a0e
2 changed files with 20 additions and 0 deletions
+4
View File
@@ -165,6 +165,10 @@ def _fd_is_truly_unlinked(fd_path: str, watched_path: str) -> bool:
names — the guard keeps failing closed."""
try:
fd_stat = os.stat(fd_path)
except FileNotFoundError:
# The descriptor was closed after /proc was read. It cannot keep a
# retired generation alive, so do not turn this scan race into a halt.
return False
except OSError:
return True
return _identity_is_truly_unlinked((fd_stat.st_dev, fd_stat.st_ino), watched_path)