Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rarely cache can serve old value having slower backend #93

Closed
wants to merge 3 commits into from

Conversation

@jardakotesovec
Copy link
Contributor

jardakotesovec commented Oct 1, 2014

Assuming that get method from engine is asynchronous and can take bit more time occasionally, there is time window, when cache can serve accidentally old value.

If generateFunc is faster than staleTimeout or generateTimeout it will fire old values via setTimeout and if there are pending callbacks it will send old value. Its only short window, when there are pending callbacks that can be hit by this setTimeout, its after calling get on cache engine, while waiting for response.

@jardakotesovec jardakotesovec changed the title Concurrency Rarely cache can serve old value having slower backend Oct 1, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.