Skip to content

ci(maven): keep a Maven Central rate limit from running a warm Java job out of its time - #2663

Merged
HuiJun merged 1 commit into
developfrom
ci/java-maven-429-window
Nov 26, 2026
Merged

HuiJun merged 1 commit into
developfrom
ci/java-maven-429-window

Conversation

@HuiJun

@HuiJun HuiJun commented Nov 26, 2026 •

Copy link
Copy Markdown
Collaborator

What and why

Maven asks every remote repository for its prefix file (.meta/prefixes.txt) in each run, whatever ~/.m2/repository holds. When Maven Central answers that with HTTP 429, each mvn call spends the whole backoff of eight retries, about three minutes, per repository, before it does any work. In merge-queue run 45544265508 that cancelled Java client tests at its 15 minutes although the dependency cache had been restored.

Two changes:

  • client/java, editors/mdk and editors/syson each add -Daether.remoteRepositoryFilter.prefixes.resolvePrefixFiles=false to .mvn/maven.config, so a job whose dependencies are cached sends Maven Central nothing. tests/hygiene/maven_backoff_test.go holds the line in every tree.
  • scripts/maven-sbom.sh asks Google's mirror of Maven Central on its first and third attempts and Maven Central on the second and fourth, the reverse of before. The CycloneDX plugin is in no cache, so the audit is the one step that must fetch; it now reaches Maven Central only when the mirror refuses.

The mirror attempt alone did not save the queue run: the mirror settings cover the repository central, and a second repository that a dependency's POM declares still asked Maven Central for its prefix file. The first change removes that request.

scripts/download-pilot-validator.sh is left as it is: its hash keys the pilot validator's cache, so an edit would rebuild the validator from a cold cache.

No job is added and no timeout changes.

Before and after

Java client tests in the queue run above, under a real rate limit:

Step Time
Test and install the client 4 min 39 s, about 3 min of it retrying the prefix file
Run the conformance suite through the client 6 min 8 s, with about 6 min before the suite's first line
Audit the Java client's dependencies cancelled after 3 min 56 s; two SBOM attempts cut at 90 s

The job's three Maven calls run locally on Maven 3.10.1, from a copy of a warm local repository whose prefix file is stale, through a proxy that answers every request to repo.maven.apache.org and repo1.maven.org with 429:

Call develop this branch
mvn install (tests skipped) 194 s, 9 requests to Maven Central 13 s, none
dependency:build-classpath 1.4 s 1.4 s
scripts/maven-sbom.sh client/java 2.9.1 no SBOM after 200 s, two attempts cut at 90 s 4 s, 5 requests, all to the mirror

With the proxy passing everything through, the same calls on this branch make no request to Maven Central either; on develop the install makes one and the SBOM step nine.

How it was verified

  • scripts/maven-sbom-test.sh passes with its cases rewritten for the new order: the mirror answers, Maven Central down, the mirror down, the mirror recovering, both down, a stall, and the three timeout variants.
  • go test ./tests/hygiene, go vet ./tests/hygiene, gofmt -l, shellcheck on the two scripts and python3 scripts/changelog.py check pass.
  • The local measurements above.

Not verified: the workflow itself under a real 429, the install step with its tests running (they were skipped locally), and the Maven version of the hosted runner, which the job's log does not print. Maven 3.9 has no prefix-file discovery and ignores the new line.

Checklist

  • make test and make lint pass locally (only the gates listed above were run)
  • Tests added or updated for the change
  • Documentation extended where it already covers the surface (see CONTRIBUTING.md)
  • Changelog entry added as changes/unreleased/<slug>.<section>.md, not as an edit to CHANGELOG.md
  • baselines regenerated and make docs-counts run if a gate count moved (none moved)
  • No internal work-item labels (waves, slices, F4, K5) in the body, docs, or changelog

🟢 Devin Review found nothing to fix · View findings

Devin Review

…b out of its time

Maven 3.10 asks every remote repository for its prefix file in each run,
whatever the local repository holds, and an HTTP 429 to that costs each
mvn call about three minutes of backoff per repository. Each tree's
.mvn/maven.config now asks for no prefix files, and scripts/maven-sbom.sh
asks the mirror of Maven Central first and Maven Central when the mirror
refuses.

Co-Authored-By: jason.han <hanhuijun@gmail.com>
@devin-ai-integration

Copy link
Copy Markdown
Contributor

I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".

  • Disable automatic comment, CI, and merge conflict monitoring

@devin-ai-integration devin-ai-integration Bot 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.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Devin Review

@devin-ai-integration

Copy link
Copy Markdown
Contributor

QA: pass

Tested head 06026d4bc6 merged onto develop at f6b91f3c0e (the base when the run started; develop has moved since), against that base alone. No step failed unexpectedly, so there are no failure screenshots.

Recording of the run

Summary of every step

Setup. Maven 3.10.2, Java 21, a private warm local repository, and a local proxy that answers chosen hosts (repo.maven.apache.org, repo1.maven.org, Google's mirror) with HTTP 429. The steps are the three Maven steps of Java client tests, run as the workflow runs them, tests included.

The Java job with Maven Central answering 429, warm cache

Step (limit) develop with this PR
mvn install -Dopensysml.requireService=true (15 min job) 254 s, 9 requests for prefixes.txt, all 429 74 s, no request
conformance suite 187 s, 9 requests, all 429 6 s, no request
make audit-java (10 min step) 107 s, 6 of 130 requests 429 7 s, 120 requests, none 429
total 548 s 87 s

With no 429 at all the PR's three steps take 74 s, 6 s and 7 s, so the rate limit no longer costs anything. editors/mdk and editors/syson under the same 429: 11 s and 9 s, no request to Maven Central.

Still fails when it should

Case Result
The mirror answers 429, Maven Central answers audit passes in 107 s, on the second attempt
The mirror and Maven Central both answer 429 audit exits 2 after 420 s (four attempts), inside its 10 min step
bin/sysml-grpc absent with -Dopensysml.requireService=true install exits 1
A broken pom.xml given to scripts/maven-sbom.sh exits 1 in 1 s, not retried
The new line removed from one maven.config tests/hygiene fails

CI config. circleci config validate, shellcheck on the two scripts, scripts/maven-sbom-test.sh and the Maven hygiene tests pass on the base and on the merge. actionlint reports the same two shellcheck style notes in pr.yml on both. The PR changes no file under .github or .circleci.

Hosted CI. In the queue run the description cites, the Java job's log shows the repeated 429 on .meta/prefixes.txt, then SBOM attempts cut at 90 s, then the cancellation. On this head Java client tests and the MDK and SysON jobs passed, with the audit reporting no issues.

Past fixes. Of the 42 inventory rows whose tests live in the three Maven trees or the Maven and CI hygiene tests, 39 pass (35 test files), 2 have no test (#1190, #1602) and 1 was not run (below). The Go packages holding the tests of the 15 Tim Weilkiens rows all pass (15 packages); none of those rows is in the Java, Maven or CI area.

Not run

  • The workflow itself under a real Maven Central 429; the rate limit here is simulated, and the hosted runner's Maven version is not known.
  • Java 17, which the hosted job uses; the local runs used Java 21.
  • editors/syson/frontend/src/registry/opensysmlExtensionRegistry.test.ts (row fix(syson): render the run tool in the explorer palette #1117), a frontend test this PR does not touch.
  • The full tests/hygiene suite as a gate: TestSharedDigestTablePinsEveryRecordedRelease fails on develop and on the merge alike (v0.13.0 not pinned), unrelated to this PR.

One observation, not a failure of this PR. A CycloneDX plugin version that does not exist is treated as a fetch failure and retried: scripts/maven-sbom.sh client/java 0.0.0-not-a-version exited 124 after 243 s instead of failing at once. Seen on the merge only; not compared with develop.

@HuiJun
HuiJun added this pull request to the merge queue Nov 26, 2026
Merged via the queue into develop with commit 8b71b72 Nov 26, 2026
73 of 99 checks passed
@HuiJun
HuiJun deleted the ci/java-maven-429-window branch November 26, 2026 10:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant