Skip to content

[CELEBORN-2484][BUILD] Make sbt downloads resilient to transient Maven Central failures - #3877

Closed
afterincomparableyum wants to merge 2 commits into
apache:mainfrom
afterincomparableyum:sbt-launcher-download-retry
Closed

afterincomparableyum wants to merge 2 commits into
apache:mainfrom
afterincomparableyum:sbt-launcher-download-retry

Conversation

@afterincomparableyum

@afterincomparableyum afterincomparableyum commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

  • build/sbt-launch-lib.bash: the sbt launcher download now retries. It adds --retry-all-errors when curl is 7.71 or newer, because plain --retry skips DNS, connection and 403 errors. It prints the download error, and if repo1 still fails it falls back to Google's Maven Central mirror. That fallback is skipped when DEFAULT_ARTIFACT_REPOSITORY is set.
  • build/sbt-config/repositories: point gcs-maven-central-mirror at the live /maven2/ path. The old /repos/central/data/ path returns 404. repositories-asia.template already uses /maven2/.

Why are the changes needed?

SBT CI jobs fail before any test runs whenever Maven Central has a brief error:

  • The launcher was fetched with a single silent curl and no retry. The job died in under a second with only Our attempt to download sbt locally ... failed in the log (job 1, job 2). The Actions cache is at its 10GB limit, so the cached launcher is usually evicted and every matrix job downloads it.
  • The GCS mirror path was dead, so every dependency came from repo1 alone. A single connection reset failed the build (job 3: could not retrieve sbt 1.9.4).

Does this PR resolve a correctness bug?

  • Yes

Does this PR introduce any user-facing change?

  • Yes

How was this patch tested?

  • Ran the launcher download locally three ways: normal, with repo1 returning 404, and with repo1 failing DNS. Each case retried as expected, fell back to the mirror and produced a valid jar.
  • curl against the GCS mirror: /maven2/ returns 200 and /repos/central/data/ returns 404.
  • CI on this PR covers the full dependency resolution through the corrected mirror.

…n Central failures

build/sbt fetched sbt-launch.jar from repo1.maven.org with a single
`curl --silent` call and no retry. Any brief failure from Maven Central
(DNS, connection reset, 403/429 throttling) failed the whole CI job
before a single test ran, and the log never said why. The repo's Actions
cache sits at its 10GB limit, so the cached launcher is usually evicted
and every SBT matrix job downloads it at the same time.

Dependency resolution had the same weak point. build/sbt-config/repositories
lists Google's Maven Central mirror ahead of repo1, but at the old
/repos/central/data/ path, which now returns 404. Every artifact was
really fetched from repo1 alone, so a repo1 connection reset failed the
build (e.g. "could not retrieve sbt 1.9.4" when the launcher couldn't
download scala-reflect).

- Retry the launcher download with curl/wget, and add --retry-all-errors
  when curl supports it (7.71+), because plain --retry skips DNS,
  connection and 403 errors.
- Print the download error instead of hiding it.
- If repo1 still fails, fetch the launcher from Google's Maven Central
  mirror. Skip that fallback when DEFAULT_ARTIFACT_REPOSITORY is set, so
  builds limited to an internal repo stay that way.
- Point gcs-maven-central-mirror at the live /maven2/ path, as
  repositories-asia.template already does, so dependencies have a
  working mirror ahead of repo1.

@zaynt4606 zaynt4606 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.

Thanks for working on this. I found one issue in the new retry path that needs a fix before approval.

Comment thread build/sbt-launch-lib.bash Outdated

@zaynt4606 zaynt4606 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.

Thanks for addressing the partial-download issue. Using curl --output resolves my concern. LGTM from the code review; CI is still running at the time of this approval.

@zaynt4606 zaynt4606 closed this in eca6745 Oct 19, 2026
@zaynt4606

Copy link
Copy Markdown
Contributor

Merge Summary:

Posted by merge_pr.py

@zaynt4606

Copy link
Copy Markdown
Contributor

Thanks @afterincomparableyum for the contribution!
Merged to main(v1.0.0).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants