fix: fsync parent dir after direct-write fallback for durability parity

This commit is contained in:
Matt Van Horn 2026-07-05 04:11:12 -07:00
parent b00d4785ee
commit 54463baf0e
No known key found for this signature in database

View file

@ -169,6 +169,8 @@ class AtomicJsonStore:
f.write(text)
f.flush()
self._best_effort_fsync(f.fileno())
# Make the new directory entry durable too, matching the atomic path.
self._fsync_directory(os.path.dirname(self.path) or ".")
@staticmethod
def _best_effort_fsync(fileno: int) -> None: