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: only retry 5xx Cloud SQL Admin API errors #375

Merged
merged 3 commits into from
Jul 12, 2024
Merged

Conversation

jackwotherspoon
Copy link
Collaborator

@jackwotherspoon jackwotherspoon commented Jul 10, 2024

This commit fixes the retry behavior of 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. Using gaxios default exponential backoff.

Previously the Node Connector was only retrying 3 times and for
all error codes.

Updating gaxios version to have newer params available.

Fixes #371

@jackwotherspoon jackwotherspoon self-assigned this Jul 10, 2024
@jackwotherspoon jackwotherspoon marked this pull request as ready for review July 11, 2024 16:26
@jackwotherspoon jackwotherspoon requested a review from a team as a code owner July 11, 2024 16:26
@enocom
Copy link
Member

enocom commented Jul 11, 2024

How does this affect the range of best case to worst case in terms of time taken?

@jackwotherspoon
Copy link
Collaborator Author

How does this affect the range of best case to worst case in terms of time taken?

I can look at calculating it, the formula used by default is found here:

https://github.com/googleapis/gaxios/blob/main/src/retry.ts#L178

@jackwotherspoon
Copy link
Collaborator Author

Did a test and got the following delays:

Retry attempts and delay in ms

Attempt 0:  200
Attempt 1:  310
Attempt 2:  810
Attempt 3:  1620
Attempt 4:  2930

@enocom
Copy link
Member

enocom commented Jul 12, 2024

Thanks, Jack. LGTM.

@jackwotherspoon jackwotherspoon merged commit 67bff82 into main Jul 12, 2024
22 checks passed
@jackwotherspoon jackwotherspoon deleted the retry-5xx branch July 12, 2024 14:48
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.

Add/Verify retries around 50X errors
2 participants