-
-
Notifications
You must be signed in to change notification settings - Fork 63
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
How many requests are being used to resolve packages‽ (429 Too Many Requests) #1229
Comments
Can you try providing GITHUB_TOKEN to cargo-binatall via environment variable? NOTE that it tries to scrap from your .git-credentials or .config/gh by default, so if you already have it set, it shouldn't give such a massive 429 errors unless your GITHUB_TOKEN has hit its API rate limit, which is unlikely.
Yes, it's github since wasm-bindgen-cli source code is hosted on https://github.com/rustwasm/wasm-bindgen
cargo-binstall doesn't accept RUST_LOG, you can set log-level using --log-level and the environment variable documented in "cargo binstall --help" for --log-level.
500+ requests does seem to be strange because according to my memory, for one crate, binstall will fire at most 25-30 requests I will double check this.
Yes that's right, I will open a PR to update README.
Well we already uses a single backoff timer, but I guess we log too much? Would also have to double check this one. |
I use SSH to authenticate the git CLI with GitHub, so I don't have an ambient I've got to log off for right now (it's just after midnight here and I have something in the morning), but I'll check and see how it behaves sometime tomorrow, along with (I don't know why I didn't check The 500 number comes from seeing the log lines stop being printed to the terminal for an instant, hitting CTRL-C, then counting the lines generated. It took my terminal roughly a minute to print all those lines actually, I think, and a few more logs had been generated by the time I actually stopped the process. If it's supposed to cap around 30 for a single crate, though, something's gone wrong, because I unambiguously had over 100 log entries for a 429 result and 60s backoff in a span of less than 60s. Random guess, not having looked: make sure the requests are still holding the semaphore tokens (or whatever equivalent) while waiting on the backoff timer, so you don't end up just spinning up more requests instead of actually backing off. Not that I particularly think that's what's happening, just that it's a bug I've written before 😅
Yeah, I'd suggest a rough flow of that when receiving a 429, to log the retry iff the retry timer isn't already waiting. Then join the wait, resetting the timer (but not incrementing the backoff except for the first hit). |
You can set GITHUB_TOKEN via env, or set it in your .bashrc/.zshrc
Yeah, github applies rate limit on per-hour basis.
You can simply wait for binstall to sort it out itself, when it encountered 429 it will simply wait and retry.
That's definitely something we can improve.
Yeah, it could be that:
429 response header gives binstall a absolute time point which we should hold off until then. It doesn't give us an interval though. |
I’m also seeing unconstrained 429s. Like @CAD97, I first saw this via I’ve attached the terminal output of
|
Fixed #1229 Signed-off-by: Jiahao XU <[email protected]>
Can confirm this on a fresh reinstall today of arch linux, rustup, binstall: this bug seems to make binstall unusable: deck@steamdeck ~> cargo binstall exa
INFO resolve: Resolving package: 'exa'
WARN Your GitHub API token (if any) has reached its rate limit and cannot be used again until Instant { tv_sec: 1690802118, tv_nsec: 143434284 }, so we will fallback to HEAD/GET on the url.
WARN If you did not supply a github token, consider doing so: GitHub limits unauthorized users to 60 requests per hour per origin IP address.
WARN Your GitHub API token (if any) has reached its rate limit and cannot be used again until Instant { tv_sec: 1690802118, tv_nsec: 143434284 }, so we will fallback to HEAD/GET on the url.
WARN If you did not supply a github token, consider doing so: GitHub limits unauthorized users to 60 requests per hour per origin IP address.
^C WARN Installation cancelled The rate limiting warnings appear SO fast that it was hard to not exceed my terminal's history! Thanks so much for your work here! |
@NobodyXu I'll test now |
sadly not, I've given an update on #1231 |
Fixed #1229 Signed-off-by: Jiahao XU <[email protected]>
Fixed #1229 Signed-off-by: Jiahao XU <[email protected]>
Fixed #1229 Signed-off-by: Jiahao XU <[email protected]>
Fixed #1229 Signed-off-by: Jiahao XU <[email protected]>
Fixed #1229 Signed-off-by: Jiahao XU <[email protected]>
Fixed #1229 Signed-off-by: Jiahao XU <[email protected]>
Fixed #1229 Signed-off-by: Jiahao XU <[email protected]>
Fixed #1229 Signed-off-by: Jiahao XU <[email protected]>
Fixed #1229 Signed-off-by: Jiahao XU <[email protected]>
Fixed #1229 Signed-off-by: Jiahao XU <[email protected]>
Fixed #1229 Signed-off-by: Jiahao XU <[email protected]>
Fixed #1229 Signed-off-by: Jiahao XU <[email protected]>
Fixed #1229 Signed-off-by: Jiahao XU <[email protected]>
Fixed #1229 Signed-off-by: Jiahao XU <[email protected]>
Fixed #1229 Signed-off-by: Jiahao XU <[email protected]>
I just got 2500 (... now 4500, just CTRL-C'd it) lines dumped into my terminal that cargo-binstall was receiving HTTP 429 during a
cargo install-update -a
(while resolving packagewasm-bindgen-cli
). It really feels like something has to have gone wrong for it to generate so many 429 responses in a relatively short period of time.Whatever API is getting hit (GitHub, presumably?), I seem to have gotten my cargo-binstall throttled for the moment.
cargo install-update wasm-pack
gave me a single 429 message before I aborted it.cargo install-update wasm-bindgen-cli
seems to spit out around 500 at a time -- I'm not completely sure because my terminal emulator can't really keep up with them getting spewed out.I attempted setting
RUST_LOG
but didn't get any output other than the large number of INFO about the 429 response.It's I guess somewhat reasonable that resolution can take a bit to talk to GitHub, but it seems odd at a minimum that package resolution would involve 500+ requests in flight at the same time (and that getting throttled dumps 500+ log messages simultaneously).
Originally reported against cargo-install-update, where it was suggested that providing a
GITHUB_TOKEN
can potentially speed up resolution (and perhaps raise usage quotas); if this is the case it'd probably be a good idea to mention this (and what permissions are needed) in the README.Version info:
If nothing else, this issue can track coalescing concurrent requests onto a shared retry/backoff timer/report, to avoid generating the log spam when running into 429.
The text was updated successfully, but these errors were encountered: