Code Monkey home page Code Monkey logo

Comments (14)

chalmerlowe avatar chalmerlowe commented on June 24, 2024 2

At this point, going to close this item as "Will not fix" due to competing priorities.

from python-bigquery.

HemangChothani avatar HemangChothani commented on June 24, 2024 1

it is not possible to retry the job from within the library

@pietrodn It is possible to retry the job from within the library, for that need to use client.create_job method which creates a new 'job ID' on every retry.

def create_job(self, job_config, retry=DEFAULT_RETRY, timeout=None):

from python-bigquery.

tseaver avatar tseaver commented on June 24, 2024

@tswast I'm pretty sure that this is a back-end issue: the API shouldn't be returning '400 Bad Request' for internal server errors. Can you confirm?

from python-bigquery.

tswast avatar tswast commented on June 24, 2024

@shollyman Is this related to another BigQuery backend rollout?

from python-bigquery.

tswast avatar tswast commented on June 24, 2024

I agree that 400 Bad Request is the wrong response code for this error.

from python-bigquery.

tswast avatar tswast commented on June 24, 2024

I've filed bug 124319762 internally to track this issue. I see several similar reports internally, so this is likely not new behavior.

@bencaine1 If you have a support plan, I recommend filing a ticket with them to raise the priority of this issue on the BigQuery backend.

from python-bigquery.

tseaver avatar tseaver commented on June 24, 2024

@tswast Do you want to leave this issue open (i.e., do you imagine we will be making changes here to work around the 400?).

from python-bigquery.

tswast avatar tswast commented on June 24, 2024

Let's close this. The client workaround would be to look for certain text in the response body and ignore the response code, which I'd prefer not to do if we can avoid it.

from python-bigquery.

barrywhart avatar barrywhart commented on June 24, 2024

I saw this error again today. Has the underlying BigQuery issue been fixed? Is there another new issue with the same symptom?

If this bug continues to recur with various BigQuery bugs, I think there is (sadly) a case for having the client retry, because otherwise the non-Google customer application becomes responsible for retrying. That seems ... worse.

from python-bigquery.

tswast avatar tswast commented on June 24, 2024

Backend issue was closed as infeasible. Backend engineers say:

Connection error is the only retryable error returned as a job result, so you only need to add the logic to retry jobs.insert() if jobs.getQueryResult() returns 400 and the error reason set to the "jobBackendError" (which means that the job failed with the connection error), but I don't think you can reuse the job id for this case.

Since the job ID cannot be reused, this error is one that requires the whole job to be retried from the beginning. I think it's reasonable to do this, though will likely a bit difficult to do, as the failure won't be discovered until .result() is called.

from python-bigquery.

pietrodn avatar pietrodn commented on June 24, 2024

If the error reason is "jobBackendError", it should be definitely be included in the BigQuery error table, so that developers can deal with it appropriately.

from python-bigquery.

pietrodn avatar pietrodn commented on June 24, 2024

If the job ID is not reusable, and it is not possible to retry the job from within the library, google-cloud-bigquery could catch this BadRequest exception and re-raise is as an InternalServerError exception, so that the application code using the library can easily retry the whole class of server errors transparently.

from python-bigquery.

tswast avatar tswast commented on June 24, 2024

google-cloud-bigquery could catch this BadRequest exception and re-raise is as an InternalServerError exception,

I think this is a reasonable feature request.

from python-bigquery.

tswast avatar tswast commented on June 24, 2024

Some requirements for a custom exception:

  • Backwards compatible -- inherit from the Google API error base class
  • Preserves stacktrace -- use the exception wrapping mechanism to preserve all the context from the original exception.
  • Clear that it's a BigQuery-related custom exception from the name. Example: BigQueryServerError.
  • The message of this exception includes a code snippet on how to recreate the query job (to retry it) with Client.create_job.

from python-bigquery.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.