This repository was archived by the owner on May 6, 2026. It is now read-only.
fix: retry connection errors with memcache - #645
Merged
Conversation
The most common transient error with memcache is `ConnectionResetError`, which wasn't included in exceptions to retry. Now all connection errors are retried. Fixes googleapis#620
tseaver
approved these changes
May 7, 2021
|
|
||
| # Python 2.7 doesn't have ConnectionError. In Python 3, ConnectionError is subclass of | ||
| # OSError, which Python 2.7 does have. | ||
| ConnectionError = getattr(__builtins__, "ConnectionError", OSError) |
Contributor
There was a problem hiding this comment.
Do redis / memchache raise a bare OSError on 2.7?
Contributor
Author
There was a problem hiding this comment.
I'm not entirely sure. I'll see if I can flush out the actual behavior.
Contributor
Author
There was a problem hiding this comment.
I'm not really able to reproduce the error with the Python 2.7 runtime. It would seem that the underlying issue causing all the ConnectionResetError events with memcache is unique to the Python 3 runtime on App Engine. I think erring on the side of a broad catch, here, is OK.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
The most common transient error with memcache is
ConnectionResetError,which wasn't included in exceptions to retry. Now all connection errors
are retried.
Fixes #620