fix: coalesce concurrent cache-miss fetches (thundering herd) #93

Merged
benvin merged 1 commits from benvin/coalesce-cache-miss into master 2026-07-02 22:08:30 +10:00

1 Commits

Author SHA1 Message Date
unkinben a3b972e7b1 fix: poll the store on lock miss to coalesce cache-miss stampedes
ci/woodpecker/pr/pre-commit Pipeline was successful
ci/woodpecker/pr/test Pipeline was successful
ci/woodpecker/pr/build Pipeline was successful
On a fetch-lock miss the engine slept a flat 500ms once and, on a store
miss, fell through to fetch upstream unlocked anyway, so a cold-cache
stampede hit upstream once per waiter. Poll the store for up to 5s (100ms
interval, context-aware) so waiters pick up the leader's result instead of
duplicating the upstream fetch.

Refs #75
2026-07-02 00:44:07 +10:00