-
Notifications
You must be signed in to change notification settings - Fork 668
Setting default wait_time to 1 minute #2074
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
Conversation
For Gitlab.com most rate limits are calculated per 1 minute. Better to set the default timeout to that value
In addition to that change, I think it makes sense to log (in DEBUG level) that a rate limit 429 has occurred, but IDK how the maintainers would like to add logging here, if at all. If anyone agrees with me on this I'd love to have guidance on how to add this logging. |
Codecov Report
@@ Coverage Diff @@
## main #2074 +/- ##
=======================================
Coverage 94.64% 94.64%
=======================================
Files 78 78
Lines 5003 5003
=======================================
Hits 4735 4735
Misses 268 268
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Hi @bachsh thanks for looking into this! We've already had some discussion on how gitlab.com behaves - see #1889. I'm not sure we can merge your change as is, this happens in a while loop and would make some of the other code dead, and it's quite aggressive with the wait. I'd have a few questions first:
If GitLab.com no longer returns any rate-limit headers I think we should take this discussion upstream as well - clients should have some reasonable idea of how to retry these limits instead of us figuring out arbitrary waits, IMO. Or worst case scenario we should have these defaults only if the url matches gitlab.com, if we really have no other option. |
hey @nejch, thanks for looking at my PR. I guess I should've looked at open issues before opening it :) To your questions:
And yes it seems that these headers no longer exist for gitlab-com; the reporter of #1889 mentioned that as well. It is possible that Cloudflare is not passing these headers along.
|
@nejch I think it's going to take some time for gitlab.com to fix the issue. |
(also, CI is failing because of the format of the commit message and IDK how to fix this besides submitting a new one) |
@bachsh I agree, and I think the issue might never go away as it seems to be there because of user enumeration attacks. Hmm I'm not sure why this happens, maybe each subsequent request further increases the backoff requirements without providing feedback. Yes, a configurable Regarding the commit message, |
@bachsh let us know if you need any help here.
|
This Pull Request (PR) was marked stale because it has been open 90 days with no activity. Please remove the stale label or comment on this PR. Otherwise, it will be closed in 15 days. |
This PR was closed because it has been marked stale for 15 days with no activity. If this PR is still valid, please re-open. |
While debugging my code against gitlab.com (SaaS, not self-hosted) I realized that the SDK bombards the API with the same request.
I found out that for some reason, headers such as
Retry-After
are missing from the response so only the defaultwait_time
is taken into account. This means that the SDK basically doesn't wait at all.Since for Gitlab.com most rate limits are calculated per 1 minute, I think it's better to set the default timeout to that value in case rate limit headers are missing.