Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Retry delay should delay all queued requests #629

Open
jyasskin opened this issue Oct 19, 2023 · 1 comment
Open

Retry delay should delay all queued requests #629

jyasskin opened this issue Oct 19, 2023 · 1 comment
Labels
Status: Blocked Some technical or requirement is blocking the issue Type: Bug Something isn't working as documented
Projects

Comments

@jyasskin
Copy link
Contributor

I have an application that's hitting the secondary rate limit even after adding this plugin. I'm passing the following to try to recover:

const octokit = new Octokit({
  ...
  throttle: {
    ...
    onSecondaryRateLimit: (retryAfter, options:any, octokit, retryCount) => {
      octokit.log.warn(
        `Secondary rate limit exceeded for request ${options.query}`,
      );

      if (retryCount < 1 && retryAfter <= 120) {
        // Retry once and for at most 2 minutes.
        console.info(`Retrying after ${retryAfter} seconds.`);
        return true;
      }
    }
  },
});

But even though I see Retrying after 60 seconds. in the output, other requests are getting sent before the 60s delay and predictably also hitting the secondary rate limit. https://github.com/SGrondin/bottleneck#retries seems to say this shouldn't happen, but I haven't traced the code enough to see why it might be happening anyway.

@ghost ghost added this to Inbox in JS Oct 19, 2023
@gr2m
Copy link
Contributor

gr2m commented Oct 19, 2023

I've been trying to find an alternative for Bottleneck for a while now, alas without success thus far. Bottleneck has not been updated for years. Unfortunately even if you find the culprit, it will be very unlikely a bugfix might be fixed and released.

We really have to figure this out @octokit/js-community @octokit/maintainers

@gr2m gr2m added Status: Blocked Some technical or requirement is blocking the issue Type: Bug Something isn't working as documented labels Oct 19, 2023
@ghost ghost moved this from Inbox to Bugs in JS Oct 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Blocked Some technical or requirement is blocking the issue Type: Bug Something isn't working as documented
Projects
Status: 🛑 Blocked/Awaiting Response
JS
  
Bugs
Development

No branches or pull requests

2 participants