Repository navigation
[MINOR] Retry transient Maven bootstrap downloads - #13663
Conversation
|
Run Gluten Clickhouse CI on x86 |
|
Run Gluten Clickhouse CI on x86 |
1 similar comment
|
Run Gluten Clickhouse CI on x86 |
|
Hi, @yaooqinn @philo-he @LuciferYang are you familiar with this part of the CI? Could you review, please? |
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are reported for the bootstrap-download resilience changes.
No open issues 🎉
What changed in this PR
This PR makes ./build/mvn bootstrap downloads more resilient while preserving Maven version selection and invocation behavior.
Changes:
- Retries transient HTTP and network failures with up to four attempts, 3/6/12-second backoff, and
Retry-Afterwaits capped at 60 seconds. - Discards failed partial downloads and avoids retrying permanent errors.
- Adds mocked regression tests and documents bootstrap behavior and test execution.
| File | Description |
|---|---|
gluten-ut/test/src/test/python/test_mvn.py |
Adds coverage for retries, cleanup, installation reuse, and invocation preservation. |
docs/developers/NewToGluten.md |
Documents retry behavior and the regression-test command. |
build/mvn |
Adds shared curl/wget retry handling, header parsing, and partial-download cleanup. |
Review effort: Balanced
|
Run Gluten Clickhouse CI on x86 |
|
Thanks for the fix. I'm wondering whether we need this much logic for downloading one bootstrap file. The existing |
|
Run Gluten Clickhouse CI on x86 |
Assert source and checksum URL ordering independently of consecutive transport retries so the suite also covers the simplified retry helper in apache#13663 without changing bootstrap logic. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@philo-he Caching is covered separately by #13662. Official download sources, archive fallback, and checksum verification are in #13669. |
philo-he
left a comment
There was a problem hiding this comment.
Thanks @felipepessoto, the retry loop and .part handling look good. I checked locally that curl still honors Retry-After with --retry-delay set.
- I'd suggest dropping test_mvn.py. build/mvn is already exercised by every CI job that uses it, and the retry path only matters on transient failures. A 150-line mocked test for this is more maintenance than value, especially since no workflow runs it.
- The NewToGluten.md addition is quite detailed for a getting-started page. One sentence would do, e.g. "./build/mvn uses the Maven version pinned in pom.xml, downloading it if needed and retrying transient download failures."
|
Thanks, @philo-he. Removed |
Assert source and checksum URL ordering independently of consecutive transport retries so the suite also covers the simplified retry helper in apache#13663 without changing bootstrap logic. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Assert source and checksum URL ordering independently of consecutive transport retries so the suite also covers the simplified retry helper in apache#13663 without changing bootstrap logic. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Use an old-curl-compatible retry budget for rate limits and transient HTTP/network failures, with four attempts and exponential backoff. Publish only completed download archives and preserve Maven selection and invocation behavior. Add deterministic curl/wget bootstrap regression tests and document their invocation. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Read Retry-After from the final HTTP response for curl and wget. Support delay-seconds and HTTP dates using GNU or BSD date, cap each wait at 60 seconds, and preserve the four-attempt budget and minimum exponential backoff. Cover redirect headers, both date command paths, large and invalid values, and past dates with focused regression tests; update bootstrap documentation. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Strip the trailing carriage return from parsed response status codes so reasonless CRLF status lines still use the correct retry policy. Add focused curl/wget regression coverage for transient 429/503 and permanent 404 responses without reason phrases. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Older curl returns before emitting error headers with --fail, leaving the bootstrap retry loop with an unknown HTTP status. Read curl write-out status directly and classify HTTP errors explicitly so Retry-After headers remain available. Preserve the bounded retry budget, reject HTTP error bodies even when curl exits successfully, and model curl 7.61.1 failure behavior in the regression suite. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Keep the original curl/wget retry flags inside a three-invocation outer loop with 20s/40s waits and partial-file cleanup. Remove bespoke HTTP status and Retry-After/date parsing while preserving native downloader diagnostics and Maven exit behavior. Retain the download_mvn interface for the separate distribution-source PR, document the combined retry budget, and reduce regression coverage to three focused tests. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Remove the standalone mocked bootstrap test and reduce the getting-started addition to one sentence as requested in review. Leave the download retry implementation unchanged. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Increase the outer waits from 20/40 to 60/120 seconds to measure whether a longer cooldown recovers transient CI download failures. Preserve three downloader invocations, native retry flags, and partial-file handling. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
65c921b to
5dc0d58
Compare
Assert source and checksum URL ordering independently of consecutive transport retries so the suite also covers the simplified retry helper in apache#13663 without changing bootstrap logic. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Assert source and checksum URL ordering independently of consecutive transport retries so the suite also covers the simplified retry helper in apache#13663 without changing bootstrap logic. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
What changes are proposed in this pull request?
Add a small outer loop around the existing curl/wget commands: at most three downloader invocations, with experimental 60s/120s waits and partial-file cleanup. Keep native retry flags unchanged, for at most 12 curl or 9 wget transfer attempts. No custom HTTP/header/date parsing; supported curl versions retain native
Retry-Afterhandling.Preserve Maven version selection and invocation behavior. Maven builds/tests are never retried. Caching (#13662) and official download sources/checksum verification (#13669) remain separate changes.
Why the errors became more frequent?
What changed: GitHub’s [October 5 Ubuntu runner image](https://github.com/actions/runner-images/releases/tag/ubuntu24/20261004.327) upgraded Maven from 3.9.16 to 3.10.0. On October 7, #13209 changed Gluten’s wrapper to require an exact version match. Jobs that previously reused system Maven now download the pinned version instead
How was this patch tested?
In Spark 4.2 group 3 at
65c921b79, the first Maven download returned HTTP 404. The second attempt installed Maven 3.9.16, and the job passed without a workflow rerun:Of 56 bootstrap downloads checked on this commit, two needed the wrapper retry: this one recovered, while Spark 4.0 group 1 still received HTTP 429 on all three attempts. This shows that retrying helped once, not that the longer waits are better.
Retry-Afterhandling.Validated on Linux/WSL. Full CI and native/Spark builds were not run locally.
Was this patch authored or co-authored using generative AI tooling?
Generated-by: GitHub Copilot CLI 1.0.106-8.unstable.r43566476370.g869eef3 (GPT-6.1 Sol and GPT-6 Astra)