-
-
Notifications
You must be signed in to change notification settings - Fork 58
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
Fix too many 429 response #1231
Conversation
@CAD97 @halostatue Can you try this PR if you have time? |
You can find the pre-built binaries in CI once it's done. |
I had previously force-upgraded some of these tools, but the aarch64 version (I’m on macOS 13 with an M1) is reporting a different issue now: $ cargo-binstall cargo-info
INFO resolve: Resolving package: 'cargo-info'
ERROR Fatal error:
× For crate cargo-info: Failed to parse target triple: Unrecognized architecture: x86_64h
├─▶ Failed to parse target triple: Unrecognized architecture: x86_64h
╰─▶ Unrecognized architecture: x86_64h I’m not sure that this is a useful test because the error is so different. |
This is caused by #1228, we added support for a new target triple that target-lexicon doesn't have support yet. I will open a PR tomorrow, meanwhile you can use --target to override the list of targets to probe. |
❯ cargo-binstall cargo-info --targets aarch64-apple-darwin
INFO resolve: Resolving package: 'cargo-info'
WARN The package cargo-info v0.7.6 will be downloaded from third-party source QuickInstall
INFO This will install the following binaries:
INFO - cargo-info (cargo-info -> /Users/austin/.cargo/bin/cargo-info)
Do you wish to continue? yes/[no]
? yes
INFO Installing binaries...
INFO Done in 9.112601583s Various caveats around not having done much since I uploaded the log (so the 429s may have been resolved) and having previously updated all of the tools, so it’s not a perfect test, but it seems to have worked. One note, and it’s not exactly |
You can try passing Without the github-token, binstall will hit github Restful API rate-limit and fallback to creating a http request instead, so it would probably trigger 429 rate-limit again.
It seems that |
I just ran
Did I build it wrong? I just |
cc @NobodyXu |
It seems that your machine is still rate limited, but I do wonder how many warnings did you get? We cannot fix the rate limit since it is imposed by GitHub, this PR is rather to reduce amount of warnings for rate-limit. @0atman Can you run it again to see how many rate-limited warnings it produces please? |
3fd82af
to
3a5a058
Compare
Checking the CI, it seems that this PR does reduce the log, though I think there is still room to improve. We could potentially increase the rate limit locally when hitting rate limit from server. |
6fdeb0d
to
70ae598
Compare
I would like to replace |
70ae598
to
c9e480a
Compare
Looking at the CI on windows it looks like it could still generate a lot of warnings logs for this, although I do think I need some review on how to proceed. |
Aha the log comes from |
77aef10
to
07cdc92
Compare
CI shows that this PR is working and it should indeed cut the amount of excessive log to just a few of them and no longer disturbing. |
I tested this commit (07cdc92) and I get 20 info logs for the 429, which is still a bit surprising, but is significantly improved from the 100+ dropped into the terminal simultaneously. And this is with supplying a gh token, fwiw. cargo binstall wasm-bindgen-cli --github-token (gh auth token) --log-level debug | save binstall.debug.log wasm-bindgen-cli (the crate that consistently hits the 429s) is an unfortunate edge case, because with a repository path of https://github.com/rustwasm/wasm-bindgen/tree/main/crates/cli and generating lookup paths like https://github.com/rustwasm/wasm-bindgen/tree/main/crates/cli/releases/download/0.2.87/wasm-bindgen-cli-x86_64-pc-windows-msvc.tar.gz, it's never going to find the actual release binary at https://github.com/rustwasm/wasm-bindgen/releases/download/0.2.87/wasm-bindgen-0.2.87-x86_64-pc-windows-msvc.tar.gz; instead of checking the github releases, it's checking paths in the source tree. And it's checking at least 2520 such paths, I think, based on grepping the log file. |
Thank you! I will have a look once I get back to my laptop, since it's hard to open this on my phone. Tips: You could put the log in release and fold it using html tag details like this: Some very long logs.
Actually binstall does support this kind of scenario, binstall parse the repo and extract subcrate path, though the extracted path isn't guaranteed to be the actual prefix for the release and we could still improve on that. |
@CAD97 I was able to open this on iPhone using notes, and I recommends you to uplod a debug log since it is more than enough, cargo-binstall (as far as I can remember) log all useful debug info in debug log-level. When you turned on the tracing log level, it will also include logs from the dependencies, like rustls, trust-dns, making it much harder to read and makes sense of, and also potentially leaking your personal information, since rustls or reqwest logs your tls handshake (including random and session id) in the log, @CAD97 I actually suggest you to take the original log down and replace it with the debug logging. |
I do know how to use
Doesn't seem to be handling wasm-bindgen-cli: Resolved repo_info = RepoInfo {
repo: Url {
scheme: "https",
cannot_be_a_base: false,
username: "",
password: None,
host: Some(
Domain(
"github.com",
),
),
port: None,
path: "/rustwasm/wasm-bindgen/tree/main/crates/cli",
query: None,
fragment: None,
},
repository_host: GitHub,
subcrate: None,
} and this looks like because it's expecting
I did scan for PII, but still a decent idea; did so. (Well, sent the ticket to remove the file, anyway, and deleted the comment revision linking it, though ofc your quote still links it until the file dies.) |
Oh I forgot that it's just too large for a comment.
Thanks, I'd like to open a separate PR for this. We used because the other crate we support uses this schema, I suppose that we can check for "crate" and pop another url path segment for crate-name. Or perhaps we can use crate-name instead of whatever specified in the repo link.
I've edited my comment to remove it. |
07cdc92
to
4848b6e
Compare
@CAD97 I've updated this PR to fix the excessive "client side rate-limit" debug logging (it was, in fact, added in this PR), now it should be much less debug logging. P.S. I can only see one line of |
1d0ce36
to
3577ab8
Compare
cc @CAD97 @halostatue @0atman @passcod I would like this PR to get a final review and merged if everything is good. |
3577ab8
to
fc88698
Compare
Fixed #1229 Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
fc88698
to
fdc8f9f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is more of a rubber-stamp; I haven't deeply looked at this but it seems right and I trust you.
Sorry I dropped off this bug due to IRL issues - I updated to the latest version of binstall today and was delighted to find everything working! I thought it only right to come here and thank everyone who worked on it :-) |
Same here. I’m expecting to update today and I’m looking forward to this. |
Fixed #1229