googleapis / nodejs-bigquery

Node.js client for Google Cloud BigQuery: A fast, economical and fully-managed enterprise data warehouse for large-scale data analytics.

Home Page:https://cloud.google.com/bigquery/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Max Query Time, Query Retry, Job Exists?

rwmia opened this issue · comments

Getting a consistent error: ErrorClass [ApiError]: Already Exists: Job

It appears that a query lasting longer than 2 minutes causes a timeout, which then causes a retry, which then causes duplicate job. I have tried setting timeoutMs with no luck.

let options = {
      timeoutMs: 240000,
      maxRetries: 0,
      autoRetry: false
    };
    bigquery.query(query, options, function(err, rows) {
      if (err) {
        callback(err);
      } else {
        callback(null, rows);
      }
    });

Is there a hard time limit on query time which causes a retry?

Hi @rwmia The default timeout overall is 10,000 ms, but requests can start to timeout after 200,000 ms (see timeoutMs in the jobs.query reference page). If there's some fine-tuning of the retry logic you'd like to see, feel free to open a feature request and we'll take a look!