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

feat: Implement python retrying connection, which generically retries stream errors #4

Merged
merged 3 commits into from Aug 10, 2020

Conversation

from google.api_core.exceptions import GoogleAPICallError

retryable_codes = {
StatusCode.DEADLINE_EXCEEDED, StatusCode.ABORTED, StatusCode.INTERNAL, StatusCode.UNAVAILABLE, StatusCode.UNKNOWN
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CANCELLED should not be retried, it is a bug if it leaks to the client on a non-client initiated action.
RESOURCE_EXHAUSTED is the same: It should only be returned when the client is actually out of resources.
This is the same set of codes as the java client library.

Copy link

@plamut plamut left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please mind that I'm not familiar with the PubSub Lite library, thus take my review with a grain of salt, but I do think it's fine all in all.

Made two remarks that might be an opportunity for refactoring/improvement, but they should not be considered showstoppers.

@dpcollins-google dpcollins-google merged commit 11c9a69 into master Aug 10, 2020
dpcollins-google added a commit that referenced this pull request Aug 10, 2020
* feat: Implement python retrying connection, which generically retries stream errors.

* fix: Add asynctest to tests_require.

* feat: Implement DefaultRouingPolicy

* fix: Add class comments.

* feat: Implement python retrying connection, which generically retries stream errors (#4)

* feat: Implement python retrying connection, which generically retries stream errors.

* fix: Add asynctest to tests_require.

* fix: Add class comments.

* feat: Implement DefaultRouingPolicy

* fix: Add class comments.

* docs: Add comment to DefaultRoutingPolicy.
@anguillanneuf anguillanneuf deleted the retrying_connection branch March 25, 2022 22:36
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.

None yet

3 participants