Skip to content

Automatic retry request for all rate limit responses #460

Description

@ryanseys

We should have a global setting to automatically retry requests (with exponential back-off) that receive a rate limit response. It should be turned on by default, have a retry limit of 3-5 that is configurable and additionally be configured to be turned off altogether.

Something like:

var gcloud = require('gcloud')({ retryLimit: 5 });

and

var gcloud = require('gcloud')({ autoRetry: false });

We should be clear that this setting is only for responses related to rate limits being reached and not that it will retry every request regardless of response error.

Activity

  1. stephenplusplus commented on Mar 23, 2015

    @stephenplusplus
    Contributor

    Just look for error code 429: TooManyRequests?

    The Google Cloud Storage JSON API per-project usage limit was exceeded. If your application tries to use more than its limit, additional requests will fail. You can see API usage limits on the Quotas pane in the Google Developers Console.

    And 503: ServiceUnavailable?

    Please reduce your request rate.

  2. added this to the Core Future milestone on Mar 23, 2015
  3. tmatsuo commented on Mar 25, 2015

    @tmatsuo
    Contributor

    I think you may want to also look for 500.

    There are inevitable non-zero intermittent 5xx errors with distributed systems like the current supported Google APIs, I would like to retry in such cases, as well as rate limited errors.

  4. ryanseys commented on Mar 28, 2015

    @ryanseys
    ContributorAuthor

    Apparently it's there's no way for me to test this locally because I never get rate limited on my machine. I have no idea why that is. I literally just made 100 buckets in ~1 second, no rate limit.

    giphy

  5. tmatsuo commented on Mar 28, 2015

    @tmatsuo
    Contributor

    Maybe you can explicitly configure the lower user limit on your project?

  6. ryanseys commented on Mar 30, 2015

    @ryanseys
    ContributorAuthor

    @tmatsuo Any idea what this error code is? https://travis-ci.org/GoogleCloudPlatform/gcloud-node/builds/56411032

    Excerpt:

    Error: The service was unable to fulfill your request. Please try again.

  7. tmatsuo commented on Mar 30, 2015

    @tmatsuo
    Contributor

    Does it always happen?
    If not, they are just intermittent errors, and they're not limited only to Pub/Sub.

    What was the HTTP status BTW?

  8. ryanseys commented on Mar 30, 2015

    @ryanseys
    ContributorAuthor

    No it doesn't always happen. Just trying to track down the code because this occurred with rate limiting PR merged (checking and retrying 500, 503 and 429)

  9. 21 remaining items

  10. added a commit that references this issue on Jul 23, 2025
  11. added a commit that references this issue on Mar 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

🚨This issue needs some love.coretriage meI really want to be triaged.

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions