eko/gocache

Avoid parallel running a load function for the same key

advoretsky opened this issue · 2 comments

It's worth to implement parallel run of the load function for the same key on cache miss. Without it under load cache may proxy multiple requests to a backend for the same key.

eko commented

Thank you for fixing this. I consider this issue can be closed

adding search keywords: LoadableCache, loader called multiple times. (I'm running v4.1.5 and it took me a while to track down this bug; I did an issue search but didn't find this until I git blamed the singleflight lines in v4.1.6 and saw that they're new.)