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

Closed
opened 2026-07-02 00:20:17 +10:00 by unkinben · 0 comments
Owner

On a lock miss Engine.Fetch (internal/proxy/engine.go:77) sleeps a flat 500ms once, tries the store, and otherwise fetches upstream unlocked anyway. A cold-cache stampede still hits upstream N times. Use a store-poll loop up to the lock TTL and/or singleflight for in-process coalescing.

On a lock miss `Engine.Fetch` (`internal/proxy/engine.go:77`) sleeps a flat 500ms once, tries the store, and otherwise fetches upstream unlocked anyway. A cold-cache stampede still hits upstream N times. Use a store-poll loop up to the lock TTL and/or singleflight for in-process coalescing.
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: unkin/artifactapi#75