Add cache clear on error for inc, touch, delete_many, add #1
+16
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This adds django-elasticache's exception handling to additional cache commands.
We were seeing some commands executed in a recent incident with logs suggesting the response was for a different type of command entirely. This could have been caused by any of these commands hitting exception cases like timeouts, then the response buffer being reused despite being half-full of data from the failed request.
I'm speculating a little, and we won't necessarily be able to see the issue without the accompanying timeouts / exceptions to verify, but it seems like a safe change to make. This certainly isn't the only thread safety issue in our cache library stack though.
Note: The original author even acknowledged the problem here, but the PR stalled due to unrelated changes
gusdan#27 (comment)