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(bigquery): reduce default backoffs #10558

Merged
merged 3 commits into from
Jul 17, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions bigquery/bigquery.go
Original file line number Diff line number Diff line change
Expand Up @@ -234,9 +234,9 @@ func runWithRetry(ctx context.Context, call func() error) error {
func runWithRetryExplicit(ctx context.Context, call func() error, allowedReasons []string) error {
// These parameters match the suggestions in https://cloud.google.com/bigquery/sla.
Copy link
Contributor

Choose a reason for hiding this comment

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

Sounds like with those changes, it is not going to match the suggestions found in https://cloud.google.com/bigquery/sla

"Back-off Requirements" means, when an error occurs, the Customer Application is responsible for waiting for a period of time before issuing another request. This means that after the first error, there is a minimum back-off interval of 1 second and for each consecutive error, the back-off interval increases exponentially up to 32 seconds.

...a minimum back-off interval of 1 second...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ahh yes. I'll back out the retry changes.

backoff := gax.Backoff{
Initial: 1 * time.Second,
Initial: 50 * time.Millisecond,
Max: 32 * time.Second,
Multiplier: 2,
Multiplier: 1.3,
}
return cloudinternal.Retry(ctx, backoff, func() (stop bool, err error) {
err = call()
Expand Down
4 changes: 2 additions & 2 deletions bigquery/job.go
Original file line number Diff line number Diff line change
Expand Up @@ -356,8 +356,8 @@ func (j *Job) waitForQuery(ctx context.Context, projectID string) (Schema, uint6
call = call.FormatOptionsUseInt64Timestamp(true)
setClientHeader(call.Header())
backoff := gax.Backoff{
Initial: 1 * time.Second,
Multiplier: 2,
Initial: 50 * time.Millisecond,
Multiplier: 1.3,
Max: 60 * time.Second,
}
var res *bq.GetQueryResultsResponse
Expand Down
Loading