Skip to content

Cache recheck before singleflight - #8

Open
zalenskivolt wants to merge 2 commits into
kofalt:masterfrom
zalenskivolt:cache-recheck-before-singleflight
Open

zalenskivolt wants to merge 2 commits into
kofalt:masterfrom
zalenskivolt:cache-recheck-before-singleflight

Conversation

@zalenskivolt

Copy link
Copy Markdown

When cache misses are detected, multiple singleflight function calls may be queued up and will all execute.

To test this easily, I added an afterCacheMissForTest func(), with two failing tests for Call and Memoize.

I think the standard fix is to check the cache again once the function call is protected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant