From 037e9efa929ad9f8d6f725b28ec8096c3e536b76 Mon Sep 17 00:00:00 2001 From: shollyman Date: Wed, 17 Jul 2024 08:42:02 -0700 Subject: [PATCH] fix(bigquery): reduce default backoffs (#10558) * fix(bigquery): reduce the initial backoff for job polling This PR reduces the initial backoff used during job polling from 1s to 50ms. In practice most time is spent in the hanging poll on the server side in GetQueryResults, so this reduces opportunities for wasted waiting. Fixes: https://github.com/googleapis/google-cloud-go/issues/10555 --- bigquery/job.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bigquery/job.go b/bigquery/job.go index d1d7f0631ac5..ba69e647f9da 100644 --- a/bigquery/job.go +++ b/bigquery/job.go @@ -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