npm @google-cloud/bigquery の Retry オプション autoRetry, maxRetries のデフォルト値

npm @google-cloud/bigquery の Retry オプション autoRetry, maxRetries のデフォルト値を調べたのでご紹介します。

Google Big Query

npm @google-cloud/bigquery について

npm @google-cloud/bigquery の Retry オプション

autoRetry, maxRetries のデフォルト値

npm @google-cloud/bigquery の Retry デフォルト値設定は自動リトライ ON、最大リトライ回数3になってるようでした。

 * @property {boolean} [autoRetry=true] Automatically retry requests if the
 *     response is related to rate limits or certain intermittent server errors.
 *     We will exponentially backoff subsequent requests by default.
 * @property {number} [maxRetries=3] Maximum number of automatic retries
 *     attempted before returning the error.

https://github.com/googleapis/nodejs-bigquery/blob/ce2c00062b4c0b7acedd1c4d2a5dc64bd402cf1f/src/index.ts#L180-L184

  • autoRetry: true
  • maxRetries: 3

autoRetry, maxRetries の設定変更サンプル

自動リトライ設定をOFFにする

const bigqueryClient = new BigQuery({ autoRetry: false });

リトライ回数を最大1回にする

const bigqueryClient = new BigQuery({ maxRetries: 1 });

以上、npm @google-cloud/bigquery の Retry オプション autoRetry, maxRetries のデフォルト値を把握した、現場からお送りしました。