publish-stable: atomic swap, no 404 window, stale staging cleaned #27
Loading…
Reference in a new issue
No description provided.
Delete branch "aqua/publish-atomic"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Follow-up chat-s6259-6261. The #26 swap was rename(live, live.old); rename(stage, live); rmtree(old): a window where the URL is missing (reader got FileNotFoundError in the new test against the old code), a kill inside it left it missing until the next run, and killed runs leaked .stage-* dirs. Fix: renameat2(RENAME_EXCHANGE) (refuses to run non-atomically if unavailable), flock per target, stale staging removed at the start of the next run. test_interruption.py (4 tests): kill at every counted filesystem mutation over an existing page and over a first publish, a raising step, 4 concurrent readers over 30 swaps; run against the old code it FAILS (reader FileNotFoundError; stale staging after a kill), against the new code it passes with the 6 existing tests. Inherent: a reader opening two files may straddle a swap (old index, new audio); no swap fixes that. Linux/ext4-xfs-tmpfs only. Not deployed; run of the real publish not repeated.
Generated with Claude Code (https://claude.com/claude-code)