-
Notifications
You must be signed in to change notification settings - Fork 187
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
handling memcache failures #78
Conversation
count = cache.incr(cache_key) | ||
try: | ||
count = cache.incr(cache_key) | ||
except ValueError: # add failed or value expired |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: Comments require two space before them when they're inline like this.
When you say "some memcached backends", which ones are you talking about specifically? Are there links to documentation about the issue? |
This affected us @YPlan too 😄 The cause of this is not 'sporadic', but a race condition with evictions; The We are currently using a similar patch like this one but with some tests 😄 I've submitted it as a second PR here: #81 |
Closing in favor of #81 (which itself may be fixed) |
@adamchainz et al, can you check to see if #88 fixed this for you? |
Yes it did./ |
Some memcached backeds return
False
from theadd
function due to sporadic failures. In this case the following call toincr
will raise aValueError
, and the call toget
will returnNone
.