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

bootstrap doesn't retry downloads that fail with a non-HTTP error #110178

Closed
jyn514 opened this issue Apr 11, 2023 · 18 comments · Fixed by #129134
Closed

bootstrap doesn't retry downloads that fail with a non-HTTP error #110178

jyn514 opened this issue Apr 11, 2023 · 18 comments · Fixed by #129134
Labels
A-spurious Area: Spurious failures in builds (spuriously == for no apparent reason) C-bug Category: This is a bug. E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. E-mentor Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion. regression-from-stable-to-stable Performance or correctness regression from one stable version to another. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

Comments

@jyn514
Copy link
Member

jyn514 commented Apr 11, 2023

We're passing --retry:

"--retry",

but by default that only retries 500 errors, not any error: https://everything.curl.dev/usingcurl/downloads/retry#retry-on-any-and-all-errors

Originally posted by @jyn514 in #109875 (comment)

@jyn514 jyn514 added T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) A-spurious Area: Spurious failures in builds (spuriously == for no apparent reason) C-bug Category: This is a bug. labels Apr 11, 2023
@jyn514
Copy link
Member Author

jyn514 commented Apr 11, 2023

This is a regression from when I moved the downloads from python to rust (about a year ago now I think).

@jyn514 jyn514 added the regression-from-stable-to-stable Performance or correctness regression from one stable version to another. label Apr 11, 2023
@rustbot rustbot added the I-prioritize Issue: Indicates that prioritization has been requested for this issue. label Apr 11, 2023
@Noratrieb Noratrieb added the E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. label Apr 11, 2023
@albertlarsan68
Copy link
Member

Mentoring instructions:

Add the --retry-all-errors option to the curl invocations, in

"--retry", "3", "-Sf", url],
and
"--retry",

This doesn't affect the Windows Powershell fallback, since we already retry on any error.
There are many other curl invocations across the repo, but they seem to not be causing problems.

@albertlarsan68 albertlarsan68 added the E-mentor Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion. label Apr 11, 2023
@kayagokalp
Copy link

@rustbot claim

matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Apr 13, 2023
…kanonur

fix: use `--retry-all-errors` instead of `--retry` in curl invocations of bootstrap download

closes rust-lang#110178.
@apiraino apiraino removed the I-prioritize Issue: Indicates that prioritization has been requested for this issue. label Apr 13, 2023
@onur-ozkan
Copy link
Member

This is quite new flag shipped with recent versions of curl, which is not supported on many machines/platforms(including our CI runners).

We can consider using --retry-connrefused as I also suggest at #110245 (comment)

matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Apr 14, 2023
…kanonur

fix: use `--retry-connrefused` in curl invocations of bootstrap download

helps with rust-lang#110178.
@exdx
Copy link

exdx commented Dec 10, 2023

I'd like to take a look at this. Looking through the PR history, we would like basic retry logic written in Rust versus using a curl flag like --retry to retry during the bootstrap process. If it's a 404, then do not retry, but any other errors should be retried. I assume there is a http library already vendored in, so no new dependencies should be added.

@exdx
Copy link

exdx commented Dec 10, 2023

@rustbot claim

@onur-ozkan
Copy link
Member

onur-ozkan commented Dec 10, 2023

I'd like to take a look at this.

Thanks!

we would like basic retry logic written in Rust
I assume there is a http library already vendored in, so no new dependencies should be added.

This shouldn't be needed. For now, retrying on "connection refused" (#110178 (comment)) should be fine.

@exdx
Copy link

exdx commented Dec 15, 2023

I'd like to take a look at this.

Thanks!

we would like basic retry logic written in Rust
I assume there is a http library already vendored in, so no new dependencies should be added.

This shouldn't be needed. For now, retrying on "connection refused" (#110178 (comment)) should be fine.

I'm a little confused as to why #110245 was closed then. What more is there beyond adding the retry refused connections flag?

@onur-ozkan
Copy link
Member

I forgot that our CI runners depend on very old curl versions which doesn't support the flag I suggested. Sorry, you are right. As jyn also said(#110245 (comment)) in that PR, we can handle this in Rust

@exdx
Copy link

exdx commented Dec 19, 2023

@onur-ozkan @jyn514 are we ok with adding the http dependency to facilitate sending requests to the payload URL? I'm very hesitant to add another crate dependency to the core payload. But without it, we would need to manually built a request via the standard library tcp library. Which is a little awkward.

http doesn't actually have support for sending requests. I suppose, in the case we decide to use it, another library would need to be added as well?

@onur-ozkan
Copy link
Member

What about using curl arguments to read the status code and handle it in rust logic? It might be a bit ugly, but adding a dependency solely for this purpose seems like overkill to me.

@exdx
Copy link

exdx commented Dec 20, 2023

What about using curl arguments to read the status code and handle it in rust logic? It might be a bit ugly, but adding a dependency solely for this purpose seems like overkill to me.

I agree adding a new dep seems extreme. I can try parsing the curl exit code, great idea.

@Vrajs16
Copy link

Vrajs16 commented Jan 27, 2024

@rustbot claim

@rustbot rustbot assigned Vrajs16 and unassigned exdx Jan 27, 2024
@danik292
Copy link

@rustbot claim

@danik292
Copy link

@jyn514 Hello Is this still relevant?

@jyn514
Copy link
Member Author

jyn514 commented Aug 15, 2024

please don't ping me about rust-lang/ issues. @onur-ozkan is the current maintainer.

@onur-ozkan
Copy link
Member

@jyn514 Hello Is this still relevant?

We didn't change any curl flags since then; it should be still relevant.

@danik292
Copy link

@rustbot release-assignment

lolbinarycat added a commit to lolbinarycat/rust that referenced this issue Aug 16, 2024
tgross35 added a commit to tgross35/rust that referenced this issue Aug 25, 2024
bootstrap: improve error recovery flags to curl

alternative to rust-lang#128459

fixes rust-lang#110178

r? `@Kobzol`
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Aug 25, 2024
bootstrap: improve error recovery flags to curl

alternative to rust-lang#128459

fixes rust-lang#110178

r? ``@Kobzol``
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Aug 25, 2024
bootstrap: improve error recovery flags to curl

alternative to rust-lang#128459

fixes rust-lang#110178

r? ```@Kobzol```
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Aug 25, 2024
bootstrap: improve error recovery flags to curl

alternative to rust-lang#128459

fixes rust-lang#110178

r? ````@Kobzol````
@bors bors closed this as completed in 12e6389 Aug 25, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this issue Aug 25, 2024
Rollup merge of rust-lang#129134 - lolbinarycat:continue-at, r=Kobzol

bootstrap: improve error recovery flags to curl

alternative to rust-lang#128459

fixes rust-lang#110178

r? ````@Kobzol````
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-spurious Area: Spurious failures in builds (spuriously == for no apparent reason) C-bug Category: This is a bug. E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. E-mentor Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion. regression-from-stable-to-stable Performance or correctness regression from one stable version to another. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

10 participants