Skip to content

Offer only freshly encoded packs, failing only on allocation, and pin evicted-pack misses with tests - #12663

Merged
rtfeldman merged 6 commits into
mainfrom
issue-12626-evicted-pack-miss
Oct 29, 2026
Merged

rtfeldman merged 6 commits into
mainfrom
issue-12626-evicted-pack-miss

Conversation

@rtfeldman

@rtfeldman rtfeldman commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Parallel builds on a cache at its size bound failed with PackDirectoryUnreadable and then NativeCompilationFailed when another roc evicted a dev pack after the loader listed its directory but before it read the file. The loader now treats such a pack as no offer, cache maintenance runs under an exclusive lock, and builds register their own packs through the indexed store; this adds the regression test for the evicted pack. It also narrows offerPack to fail only on allocation: an offer to an unavailable cache is dropped, since that cache serves no lookup, and an offered pack the command itself encoded failing to decode is a compiler invariant.

Fixes #12626

A pack another roc's sweep deletes between listing its directory and
reading it is now no offer instead of making the whole object cache
unavailable, and an offer to an unavailable cache is dropped rather than
failing the build. Sweeps of one cache root take sweep.lock so concurrent
sweeps no longer evict past the size bound, and a file that disappears
after a sweep lists it counts toward the bound.

Fixes #12626
offerPack takes only bytes the same command just encoded, so the only
failure it can report is allocation; a pack that fails to decode or index
is a compiler bug. This leaves preparing package dev packs no path that
turns an offer into NativeCompilationFailed.
@rtfeldman
rtfeldman marked this pull request as ready for review October 28, 2026 03:39
@rtfeldman rtfeldman changed the title Treat packs evicted mid-load as cache misses and serialize cache sweeps Offer only freshly encoded packs, failing only on allocation, and pin evicted-pack misses with tests Oct 28, 2026
@rtfeldman
rtfeldman merged commit 0c440e5 into main Oct 29, 2026
56 of 58 checks passed
@rtfeldman
rtfeldman deleted the issue-12626-evicted-pack-miss branch October 29, 2026 07:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant