Repository navigation
ci(maven): keep a Maven Central rate limit from running a warm Java job out of its time - #2663
Conversation
…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>
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
QA: passTested head Setup. Maven 3.10.2, Java 21, a private warm local repository, and a local proxy that answers chosen hosts ( The Java job with Maven Central answering 429, warm cache
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. Still fails when it should
CI config. Hosted CI. In the queue run the description cites, the Java job's log shows the repeated 429 on 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
One observation, not a failure of this PR. A CycloneDX plugin version that does not exist is treated as a fetch failure and retried: |
What and why
Maven asks every remote repository for its prefix file (
.meta/prefixes.txt) in each run, whatever~/.m2/repositoryholds. When Maven Central answers that with HTTP 429, eachmvncall spends the whole backoff of eight retries, about three minutes, per repository, before it does any work. In merge-queue run 45544265508 that cancelledJava client testsat its 15 minutes although the dependency cache had been restored.Two changes:
client/java,editors/mdkandeditors/sysoneach add-Daether.remoteRepositoryFilter.prefixes.resolvePrefixFiles=falseto.mvn/maven.config, so a job whose dependencies are cached sends Maven Central nothing.tests/hygiene/maven_backoff_test.goholds the line in every tree.scripts/maven-sbom.shasks 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.shis 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 testsin the queue run above, under a real rate limit: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.organdrepo1.maven.orgwith 429:developmvn install(tests skipped)dependency:build-classpathscripts/maven-sbom.sh client/java 2.9.1With the proxy passing everything through, the same calls on this branch make no request to Maven Central either; on
developthe install makes one and the SBOM step nine.How it was verified
scripts/maven-sbom-test.shpasses 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 threetimeoutvariants.go test ./tests/hygiene,go vet ./tests/hygiene,gofmt -l,shellcheckon the two scripts andpython3 scripts/changelog.py checkpass.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 testandmake lintpass locally (only the gates listed above were run)changes/unreleased/<slug>.<section>.md, not as an edit toCHANGELOG.mdmake docs-countsrun if a gate count moved (none moved)F4,K5) in the body, docs, or changelog🟢 Devin Review found nothing to fix · View findings