fix: surface real storage errors from direct-write fsync fallback

This commit is contained in:
Matt Van Horn
2026-07-05 03:49:15 -07:00
parent f315b75bb2
commit e0549d6c24
+7 -2
View File
@@ -153,8 +153,13 @@ class AtomicJsonStore:
f.flush() f.flush()
try: try:
os.fsync(f.fileno()) os.fsync(f.fileno())
except OSError: except OSError as exc:
pass # Tolerate fsync being unsupported on the underlying filesystem
# (the same class of filesystem that forced this fallback), but
# let genuine storage failures such as ENOSPC/EIO surface rather
# than reporting a durable write that did not happen.
if exc.errno not in _ATOMIC_UNSUPPORTED_ERRNOS:
raise
@staticmethod @staticmethod
def _write_payload(payload: dict[str, Any], f: Any) -> None: def _write_payload(payload: dict[str, Any], f: Any) -> None: