Prevent local cache overwrite races #1
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix-local-cache-race"
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?
The local backend could overwrite an existing cache object if another job saved the same key after the preflight exists check but before publish. That breaks the save semantics, which expect a competing writer to become a benign cache conflict.
This changes local publish to copy into a unique temporary file, then link it into place as the atomic publish step. If the destination already exists, the backend raises CacheConflictError so the save layer skips the race just like the S3 backend.
Tests run: