fix: coalesce concurrent cache-miss fetches (thundering herd) #93
Reference in New Issue
Block a user
Delete Branch "benvin/coalesce-cache-miss"
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?
Fixes #75
Why
On a fetch-lock miss,
Engine.Fetchslept a flat 500ms once, tried the store, and otherwise fell through to fetch upstream unlocked. A cold-cache stampede therefore still hit upstream once per waiter.Changes
waitForStore, which polls the store every 100ms for up to 5s (stopping on context cancellation) so waiters pick up the lock leaders populated result.Validation
make e2epasses.