From e0549d6c24518014c16296b3e54f4bd2e25af8e0 Mon Sep 17 00:00:00 2001 From: Matt Van Horn <455140+mvanhorn@users.noreply.github.com> Date: Sun, 5 Jul 2026 03:49:15 -0700 Subject: [PATCH] fix: surface real storage errors from direct-write fsync fallback --- app/state_store.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/app/state_store.py b/app/state_store.py index 2d2b2b7..5de4b24 100644 --- a/app/state_store.py +++ b/app/state_store.py @@ -153,8 +153,13 @@ class AtomicJsonStore: f.flush() try: os.fsync(f.fileno()) - except OSError: - pass + except OSError as exc: + # 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 def _write_payload(payload: dict[str, Any], f: Any) -> None: