Skip to content

fix: retry 50x errors with exponential backoff - #1125

Merged
jackwotherspoon merged 8 commits into
mainfrom
50x-retries
Jul 10, 2024
Merged

jackwotherspoon merged 8 commits into
mainfrom
50x-retries

Conversation

@jackwotherspoon

@jackwotherspoon jackwotherspoon commented Jul 8, 2024 •

Copy link
Copy Markdown
Collaborator

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
Copy Markdown
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
@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.

2 participants