-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
[BUG]: Octokit hangs when making 10 parallel requests. #2800
Comments
👋 Hi! Thank you for this contribution! Just to let you know, our GitHub SDK team does a round of issue and PR reviews twice a week, every Monday and Friday! We have a process in place for prioritizing and responding to your input. Because you are a part of this community please feel free to comment, add to, or pick up any issues/PRs that are labeled with |
It should be retrying and throttling things by default. It uses the following under the hood |
I agree. It should. But that's not what's happening. It's just stuck. |
The maximum concurrency is defined here: https://github.com/octokit/plugin-throttling.js/blob/main/src/index.ts#L30 |
Thanks. That's helpful. Unfortunately, that looks hardcoded. Do you know if there's a way to override it? Increasing it to 20 would solve the current issue, even though it's not the right solution. Ideally, it should work fine and simply queue the 10th request, but instead it hangs. |
Unfortunately I don't see a way either. These are supposed to be sensible defaults, and there has got to be a reason it's set to 10 concurrent connections. Maybe @gr2m would have more insight as to why it is that way |
We set the defaults to avoid secondary rate limiting (abuse rate limiting). The limits are not documented and are variable, so they are not a guarantee, but based on the experience over the past few years they are holding up pretty good. I agree these should be configurable for situations like yours though. I suggest we open an issue on https://github.com/octokit/plugin-throttling.js and start a draft PR for further discussion. @codiophile would you like to send one? Ping @nickfloyd @kfcampbell what do you think? |
Does this imply that this is actually intended behaviour? To me, not allowing more than 10 requests at a time seems fine, but I would expect it to queue the excess requests or at least throw an error, rather than just hang. The whole service hanging is really not useful.
I don't mind, but I have no familiarity with the project. It might take me a while to put something together. |
Yes requests should be queued. If they are not it's a bug, it would be helpful to have a simple script to reliably reproduce the problem |
What happened?
I have this polling logic that polls a list of repositories every 30 seconds to check if any of them are in need of a custom runner. It looks something like this:
When I have up to 9 repos in the list, everything works fine. When I add the 10th repo, they all hang on the octokit call. The response is never returned and no errors are thrown.
I could obviously make all these calls, one after another, to make it work, but it seems like a bug that there's an arbitrary limit of 10 and that it hangs, instead of throwing an error, or queueing the requests internally.
Versions
Octokit v4.0.2
Node v22.9.0
Relevant log output
No output at all. The calls never return, nor do they throw any errors.
Code of Conduct
The text was updated successfully, but these errors were encountered: