fix(wake): #927 enqueue TOCTOU — move stale-tmp cleanup off the hot enqueue path (no concurrent in-flight-write clobber) (#928)
All checks were successful
ci/woodpecker/push/publish Pipeline was successful
ci/woodpecker/push/ci Pipeline was successful

Co-authored-by: jason.woltje <jason@diversecanvas.com>
Co-committed-by: jason.woltje <jason@diversecanvas.com>
This commit was merged in pull request #928.
This commit is contained in:
2026-07-26 10:56:40 +00:00
committed by Mos
parent 90265ef550
commit 13e6ce5e5c
7 changed files with 301 additions and 11 deletions

View File

@@ -318,6 +318,13 @@ cmd_poll_once() {
fi
_wake_init_dir "$STATE_DIR"
# Detector-run maintenance stale-tmp reap (#927). Stale-tmp cleanup was moved
# OFF the per-enqueue hot path (it clobbered concurrent in-flight writes); the
# detector poll tick is a natural once-per-pass maintenance point that bounds
# crash-left tmp accumulation on the long-running co-feed daemon. Age-scoped,
# so it can never delete a live in-flight enqueue write (its own or a
# concurrent reconciler's).
_wake_clean_stale_tmp "$STATE_DIR"
mkdir -p "$DET_DIR"
# Iterate the DECLARED source-coverage inventory (§4/G3): only sources listed