@@ -43,7 +43,10 @@ import {
4343 JobResponse ,
4444 RowMetadata ,
4545} from './table' ;
46- import { GoogleErrorBody } from '@google-cloud/common/build/src/util' ;
46+ import {
47+ GoogleErrorBody ,
48+ RetryOptions ,
49+ } from '@google-cloud/common/build/src/util' ;
4750import bigquery from './types' ;
4851import { logger , setLogFunction } from './logger' ;
4952
@@ -216,16 +219,35 @@ export interface BigQueryOptions extends GoogleAuthOptions {
216219 * We will exponentially backoff subsequent requests by default.
217220 *
218221 * Defaults to `true`.
222+ *
223+ * @deprecated Use retryOptions.
219224 */
220225 autoRetry ?: boolean ;
221226 /**
222227 * Maximum number of automatic retries
223228 * attempted before returning the error.
224229 *
225230 * Defaults to 3.
231+ *
232+ * @deprecated Use retryOptions.
226233 */
227234 maxRetries ?: number ;
228235
236+ /**
237+ * Customize retry configuration for all requests in the SDK.
238+ * By default, a request is retried if the response is related to rate limits
239+ * or certain intermittent server errors.
240+ * We will exponentially backoff subsequent requests by default.
241+ *
242+ * More on the default retry predicate on the `shouldRetryRequest` method:
243+ * https://github.com/googleapis/nodejs-common/blob/main/src/util.ts
244+ *
245+ * Defaults:
246+ * - retryOptions.autoRetry: true
247+ * - retryOptions.maxRetries: 3
248+ */
249+ retryOptions ?: RetryOptions ;
250+
229251 /**
230252 * The geographic location of all datasets and
231253 * jobs referenced and created through the client.
@@ -388,6 +410,7 @@ export class BigQuery extends Service {
388410 packageJson : require ( '../../package.json' ) ,
389411 autoRetry : options . autoRetry ,
390412 maxRetries : options . maxRetries ,
413+ retryOptions : options . retryOptions ,
391414 } ;
392415
393416 if ( options . scopes ) {
0 commit comments