Skip to content

[MINOR] Retry transient Maven bootstrap downloads - #13663

Merged
philo-he merged 7 commits into
apache:mainfrom
felipepessoto:felipepessoto-maven-download-retries
Nov 20, 2026
Merged

philo-he merged 7 commits into
apache:mainfrom
felipepessoto:felipepessoto-maven-download-retries

Conversation

@felipepessoto

@felipepessoto felipepessoto commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

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-After handling.

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:

2026-11-20T04:35:49.4296643Z curl: (22) The requested URL returned error: 404
2026-11-20T04:35:49.4312897Z Maven download attempt 1/3 failed (curl exit 22); retrying in 60s...
2026-11-20T04:36:49.5269756Z Download completed successfully

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.

  • Local HTTP-server checks with real curl/wget verify retry budgets, cleanup, and curl's native Retry-After handling.
  • Bash syntax, license-header, and whitespace checks pass.

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)

@github-actions

Copy link
Copy Markdown

Run Gluten Clickhouse CI on x86

@github-actions github-actions Bot added CORE works for Gluten Core DOCS labels Nov 17, 2026
@github-actions

Copy link
Copy Markdown

Run Gluten Clickhouse CI on x86

1 similar comment
@github-actions

Copy link
Copy Markdown

Run Gluten Clickhouse CI on x86

@felipepessoto
felipepessoto marked this pull request as ready for review November 17, 2026 22:52
Copilot AI balanced review requested due to automatic review settings November 17, 2026 22:52
@felipepessoto

Copy link
Copy Markdown
Contributor Author

Hi, @yaooqinn @philo-he @LuciferYang are you familiar with this part of the CI? Could you review, please?

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 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-After waits 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

Copilot AI balanced review requested due to automatic review settings November 18, 2026 03:39
@github-actions

Copy link
Copy Markdown

Run Gluten Clickhouse CI on x86

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues remain for the Maven bootstrap retry and download-cleanup changes.

No open issues 🎉

Review effort: Balanced

@philo-he

Copy link
Copy Markdown
Member

Thanks for the fix. I'm wondering whether we need this much logic for downloading one bootstrap file. The existing curl --retry already covers timeouts and 5xx; the only gap on older curl is HTTP 429. A small outer loop around the existing curl/wget call (e.g. 3 attempts, 20s/40s waits, removing the partial file between attempts) would cover that in ~10 lines, without parsing Retry-After or a dedicated test. Also, since every CI job currently downloads Maven, caching build/.mvn (or installing the pinned Maven in the CI image) would avoid most of these downloads in the first place.

Copilot AI balanced review requested due to automatic review settings November 18, 2026 08:38

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues block the Maven bootstrap download retry changes.

No open issues 🎉

Review effort: Balanced

@github-actions

Copy link
Copy Markdown

Run Gluten Clickhouse CI on x86

felipepessoto added a commit to felipepessoto/gluten that referenced this pull request Nov 18, 2026
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>
@felipepessoto

Copy link
Copy Markdown
Contributor Author

Thanks for the fix. I'm wondering whether we need this much logic for downloading one bootstrap file. The existing curl --retry already covers timeouts and 5xx; the only gap on older curl is HTTP 429. A small outer loop around the existing curl/wget call (e.g. 3 attempts, 20s/40s waits, removing the partial file between attempts) would cover that in ~10 lines, without parsing Retry-After or a dedicated test. Also, since every CI job currently downloads Maven, caching build/.mvn (or installing the pinned Maven in the CI image) would avoid most of these downloads in the first place.

@philo-he
Thanks, agreed. I’ve simplified this to three outer invocations around the existing curl/wget commands, with 20s/40s waits and partial-file cleanup. The native retry flags remain unchanged, and the custom header/date parsing is gone. I kept three focused regression tests.

Caching is covered separately by #13662. Official download sources, archive fallback, and checksum verification are in #13669.

@philo-he philo-he left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @felipepessoto, the retry loop and .part handling look good. I checked locally that curl still honors Retry-After with --retry-delay set.

  1. 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.
  2. 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."

Copilot AI balanced review requested due to automatic review settings November 19, 2026 08:36
@felipepessoto

Copy link
Copy Markdown
Contributor Author

Thanks, @philo-he. Removed test_mvn.py and shortened the Maven documentation to the sentence you suggested in f8a5cf934. The retry loop and .part handling are unchanged.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues remain for the Maven bootstrap download-retry changes.

No open issues 🎉

Review effort: Balanced

@github-actions github-actions Bot removed the CORE works for Gluten Core label Nov 19, 2026
Copilot AI balanced review requested due to automatic review settings November 19, 2026 23:43

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues block the Maven bootstrap download resilience changes.

No open issues 🎉

Review effort: Balanced

felipepessoto added a commit to felipepessoto/gluten that referenced this pull request Nov 20, 2026
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>
felipepessoto added a commit to felipepessoto/gluten that referenced this pull request Nov 20, 2026
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>
felipepessoto and others added 7 commits November 20, 2026 12:57
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>
@felipepessoto
felipepessoto force-pushed the felipepessoto-maven-download-retries branch from 65c921b to 5dc0d58 Compare November 20, 2026 20:58
Copilot AI balanced review requested due to automatic review settings November 20, 2026 20:58
felipepessoto added a commit to felipepessoto/gluten that referenced this pull request Nov 20, 2026
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>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues block the Maven download retry and partial-file handling changes.

No open issues 🎉

Review effort: Balanced

@philo-he philo-he left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Thanks!

@philo-he
philo-he merged commit 047e11e into apache:main Nov 20, 2026
44 of 47 checks passed
@felipepessoto
felipepessoto deleted the felipepessoto-maven-download-retries branch November 20, 2026 22:01
@felipepessoto

Copy link
Copy Markdown
Contributor Author

Thanks @philo-he.

Could you take a look in these PR too? They also help improve the CI transient errors:

#13669
#13662

felipepessoto added a commit to felipepessoto/gluten that referenced this pull request Nov 20, 2026
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>
ReemaAlzaid pushed a commit to ReemaAlzaid/gluten that referenced this pull request Nov 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants