Files
splinter/src/backend
lotherk 4cdaf2680b store: a write that cannot finish no longer replaces the good file
jobrec_write(), write_sidecar() and provstate's write_state() wrote into a
temp, ignored the result and renamed it over the live file. A full disk (or
EIO) then left a torn json where a job record or a key's quota state used to
be. For provstate that is the dangerous direction: a truncated state parses as
all zeroes, so "this key is out of quota until 19:00" became "admit it" and the
harness hammered a spent account.

All three now fflush+fsync+fclose, unlink the temp when any step fails, and
only then rename. Test proof, both tests fail on the old code:

  test_provstate.c  RLIMIT_FSIZE=8, write_state fails -> last_status still 429,
                    preflight still waits
  test_jobs.c       RLIMIT_FSIZE=8, delegate_retry cannot write -> the record on
                    disk is still a whole json, no .tmp left behind

make check: all tests passed. tests/check_asan.sh: all 45 binaries clean.
2026-11-23 06:33:12 +00:00
..
2026-11-17 20:00:38 +00:00