-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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(bigquery): widen retry predicate #6976
Conversation
This PR adds 500,504 http response codes for the default retry predicate on unary retries. This doesn't introduce job-level retries (jobs must be recreated wholly, they can't be effectively restarted), so the primary risk of this change is terminal job state propagating into the HTTP response code of one of the polling methods (e.g. job.getQueryResults, jobs.get, etc). In this situation, the primary risk is that job execution may appear to hang indefinitely. Related: googleapis#5248
@@ -237,8 +243,10 @@ func retryableError(err error, allowedReasons []string) bool { | |||
} | |||
} | |||
} | |||
if e.Code == http.StatusServiceUnavailable || e.Code == http.StatusBadGateway { | |||
return true | |||
for _, code := range retry5xxCodes { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The function comment needs to be updated, as it mentions just the 502 and 503 errors - It also considers 502 ("Bad Gateway") and 503 ("Service Unavailable") errors retryable;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. But I think we might need to start some design doc or discussion around making the retry logic more configurable. Do we know of other client libraries that allow that to take some inspiration ?
There's some hooks we can consider such as https://pkg.go.dev/github.com/googleapis/gax-go/v2#WithRetry Storage rolled their own client-level settings: https://pkg.go.dev/cloud.google.com/go/storage#Client.SetRetry |
This PR adds 500,504 http response codes for the default retry predicate on unary retries.
This doesn't introduce job-level retries (jobs must be recreated wholly, they can't be effectively restarted), so the primary risk of this change is terminal job state propagating into the HTTP response code of one of the polling methods (e.g. job.getQueryResults, jobs.get, etc). In this situation, job execution may appear to hang indefinitely or until context cancellation/expiry.
Related: #5248