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

fix: retry 50x errors with exponential backoff #1125

Merged
merged 8 commits into from
Jul 10, 2024
Merged

Conversation

jackwotherspoon
Copy link
Collaborator

@jackwotherspoon jackwotherspoon commented Jul 8, 2024

This commit adds retry behavior to the two SQL Admin API calls.

Any response that results in a 50x error will now be retried up to
5 times with exponential backoff and jitter between each attempt.

The formula used to calculate the duration to wait is:

200ms * 1.618^(attempt + jitter)

This calculation matches what the Cloud SQL Proxy v1 did and
will not trigger any significant change in load on the backend.

@jackwotherspoon jackwotherspoon self-assigned this Jul 8, 2024
@jackwotherspoon jackwotherspoon requested a review from a team as a code owner July 8, 2024 20:21
@jackwotherspoon
Copy link
Collaborator Author

Going to add a unit test that covers retry_50x with a CloudSQLClient

@jackwotherspoon jackwotherspoon merged commit 2da9128 into main Jul 10, 2024
14 of 15 checks passed
@jackwotherspoon jackwotherspoon deleted the 50x-retries branch July 10, 2024 14:27
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

2 participants