mirror of
https://github.com/alexta69/metube.git
synced 2026-07-23 13:22:48 +00:00
fix: surface real storage errors from direct-write fsync fallback
This commit is contained in:
+7
-2
@@ -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:
|
||||||
|
|||||||
Reference in New Issue
Block a user