Skip to content
This repository was archived by the owner on Mar 6, 2026. It is now read-only.
This repository was archived by the owner on Mar 6, 2026. It is now read-only.

Should a rateLimitExceeded have a "429 Too Many Requests" instead of "403 Forbidden"?  #2006

Closed

Description

@cozos

In many cases, users want to be able to retry rateLimitExceeded errors. Many retry libraries and codebases support this by automatically retrying HTTP exceptions with a 429 Too Many Requests HTTP error, and any 5XX error codes. For example, BigQuery itself. However BigQuery will raise a 403 Forbidden for rate limit problems - see:

"rateLimitExceeded": http.client.FORBIDDEN,

A 403 Forbidden implies that the API user does not have the permissions or authentication credentials to do the thing. That seems inappropriate for a rateLimitError, right?

This mis-coding has two consequences for retry logic:

  • In codebases where you'd expect to get retries for free, you don't, because libraries won't retry a 403 Forbidden, and rightly so - why would you retry an access error.
  • Users who do want to implement retries for BQ rateLimitExceeded errors now have to retry on 403 Forbidden, possibly causing them to retry genuine permissions/auth errors that will fail no matter how many attempts.

Activity

  1. removed their assignment
    on Aug 13, 2024
  2. added
    type: bug
    priority: p2
    on Aug 13, 2024
  3. added
    api: bigquery
    on Aug 28, 2024
  4. ohmayr commented on Aug 28, 2024

    @ohmayr
    Contributor

    Transferring this issue to the Bigquery team since the error is raised from the backend API and not the client.

  5. chalmerlowe commented on Aug 29, 2024

    @chalmerlowe
    Collaborator

    This should be fixed by this PR. It seems like this might be a duplicate of Issue #1985

    #1994

    Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

api: bigquerypriority: p2type: bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions