Repository navigation
Conversation
Maven Central rate-limits the addresses that GitHub's runners share. On 2026-11-23 the android job failed on it (run 45272167046): the first request the build sent, for kotlin-gradle-plugin-2.4.21.pom, was answered 429, and the build had failed 18 seconds after it started. Gradle 9.8.1 does retry a 429, as it does 408, 5xx and a dropped connection, but three times in three seconds. Then it disables the repository for the rest of the build, which is where "52 more failures with identical causes" comes from. The number of tries is the internal property org.gradle.internal.repository.max.tentatives, 3 by default, and the wait doubles from one second. The job now sets it to 8 through GRADLE_OPTS, which reaches all three Gradle runs of the job: 1+2+...+64 = 127 seconds for one request. The job keeps resolving from an empty Gradle home. That is a control, not an omission (docs/verification.md; IR-03 and IR-05 of the v0.6 security review), so a dependency cache was not an option here. The property is undocumented and Gradle ignores a -D it does not know. A step after the first build fails when the name is no longer in the Gradle distribution the wrapper fetched, so a Gradle update cannot bring the three-second limit back unnoticed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
androidjob now gives a refused repository request about two minutes of retries instead of three seconds, and checks that the Gradle it runs still has the setting that does this. One file changes,.github/workflows/ci.yml. Nothing about dependency verification changes: the job still resolves from an empty Gradle home with--dependency-verification strict.Whether two minutes is enough for a real refusal by Maven Central is not known; see "Not verified".
What happened
Run 45272167046, job 138034512554 (2026-11-23, a pull request that touches nothing under
platform/android):Build and verify Android AARfailed 18 seconds after Gradle started.That POM is the first thing the build asks Maven Central for. So the runner's address was already limited before this job sent anything; the job's own volume did not trip the limit. Sonatype tracks its limits by the address or range it sees at its edge, and says of shared platforms that one user's traffic can be modest while the shared path as a whole still crosses the threshold (429 FAQ, shared egress, contacting support).
The other red
androidjobs of that day (runs 45265605767, 45235417813, 45171894098) are a compile error on a dependabot branch, not this.What Gradle 9.8.1 does on a 429
Read from the classes of the 9.8.1 distribution the wrapper pins (
javapongradle-dependency-management-9.8.1.jar), then measured.NetworkingIssueVerifier.isLikelyTransientNetworkingIssuecounts as transient: HTTP 5xx, 408 and 429,SocketException,SocketTimeoutException,NoHttpResponseException,ConnectionClosedException. 401 and 403 are permanent.ErrorHandlingModuleComponentRepositoryreadsorg.gradle.internal.repository.max.tentatives(default 3) andorg.gradle.internal.repository.initial.backoff(default 1000 ms), and doubles the wait after each try. Measured: requests at 0.00 s, 1.02 s and 3.03 s.Retry-Afteris ignored. A 429 withRetry-After: 10was retried after 1.00 s.org.gradle.internal.repository.max.retriesdoes not exist in 9.8.1. That name also circulates for this setting, and the task for this PR started from it. No class in the distribution contains it, and setting it to 8 changed nothing (three tries, build failed). Gradle ignores a-Dit does not know.The options
gradlewChosen: Gradle's own retry. It covers 429, it repeats only the refused request, and it leaves everything else about the job as it is.
Why not the cache. It is the only option that does not depend on how long a refusal lasts, and it is what Sonatype asks of consumers. But the empty Gradle home in this job is deliberate.
docs/verification.md: "A warm Gradle cache hides missing entries, so reproduce CI with a cold one". The v0.6 security review asks for it twice: IR-03 ("exercise it from a cold cache in CI") and IR-05 ("enforce cold-cache resolution in the blocking Android job"). Commit 150dc9d fixed exactly the kind of gap a warm cache had hidden. A cache would trade that for fewer requests, and that trade is not mine to make in a flake fix. If 429s turn out to outlast two minutes, the next step is that decision, not a larger number: for example a cache used only by pull request runs and keyed on every Gradle input, withmain, tags, dispatches and the weekly run left cold.Sonatype's FAQ also says that "the right answer is not to retry harder". This change adds at most five requests for one refused request, each further apart than the last.
The change
GRADLE_OPTS: -Dorg.gradle.internal.repository.max.tentatives=8at job level. Eight tries wait 1, 2, 4, 8, 16, 32 and 64 seconds: 127 seconds for one request. It reaches all three Gradle runs of the job: the one insidescripts/build-android-adapter.shand the two inline ones.GRADLE_OPTSand fails if the dependency-management JAR of the Gradle distribution the wrapper fetched does not contain it. Without it, a Gradle update that renames the property would bring the three-second limit back with nothing turning red.Why eight: no source gives the length of a refusal, so this is a judgement. Two minutes costs nothing on a healthy run and little on a broken one.
What it leaves out
scripts/build-android-adapter.shandscripts/test-profile-import-jni.shkeep Gradle's default. They do not run from shared addresses, and a longer budget would make an offline laptop wait two minutes for an error. SettingGRADLE_OPTSby hand works there too.ci.yml'sandroidjob is the only one.supply-chainjob. See "Not in this PR".Verification
All on macOS arm64 with JDK 17 and the Gradle 9.8.1 distribution the wrapper fetches. The stand-in servers are short Python scripts; the first is in the fold at the end.
1. A toy project against a stand-in repository. Same shape as
platform/android/build.gradle.kts: a rootbuildscriptclasspath, resolved while the project is configured.gradle help --no-daemon, empty Gradle home each time.-D…max.tentatives=8GRADLE_OPTSwith the samesystemProp.line in the project'sgradle.properties-D…max.retries=8Retry-After: 102. The real project.
platform/android/gradlew -p platform/android help --dependency-verification strict --no-daemonwith an empty Gradle home. A test-only init script, not part of this PR, pointed the Maven Central repository at a local stand-in that answers 429 for a while and then relays the real Maven Central; the bytes it relays still pass strict verification.GRADLE_OPTSRepository MavenRepo is disabled due to earlier error below, the same POM,There are 52 more failures with identical causes.BUILD SUCCESSFUL in 1m 3s. The POM was refused at 0, 1, 3, 7 and 15 s and served at 31 s; 207 requests answered 200 in all.39 more failures with identical causesBUILD SUCCESSFUL in 1m 4s; one file refused 5 times, 207 requests answered 200 in all3. The job's steps with the new environment. With
GRADLE_OPTSexported as the job sets it:scripts/build-android-adapter.sh(native libraries reused, so its Gradle tasks were up to date), the new check,:xraymobile:testDebugUnitTest(242 tests, 34 skipped, none failed) and:xraymobile:lintDebug, each with--dependency-verification strict --no-daemon. All exit 0. Before that, without the variable, the same script passed from an empty Gradle home with all four ABIs built from source.4. The new step. Its
runblock, taken out of the workflow file and run withbash -eand withbash -eo pipefail: exit 0 with the property the job sets; exit 1 with…max.retries; exit 1 with no distribution. The first pattern I wrote matched two JARs (gradle-dependency-management-serialization-codecsas well); this run caught it.5. The script tests the
rustjob lists underCheck repository scripts, with Python 3.12:bash -nover every script, the twelvescripts/tests/*.test.sh, the fourunittestlines, bothpublish-migration-benchmarks.py verifyruns, the two Python test scripts and thecheck-benchmark-publication.pyrun. All pass exceptcheck-benchmark-publication.test.sh, which fails at itsmalformed_pathcase on macOS. It fails the same way withmain'sci.ymlput back, and it does not read the workflow.Not verified
unzipandgrep. This PR's ownandroidrun is the first run of it on the runner.Not in this PR
scripts/check-gradle-verification.py --online, in thesupply-chainjob, has the same exposure and a misleading message. It fetches every pinned artifact from its canonical repository on every run, Maven Central for most, withcurl --retry 3: about seven seconds of retries. When a checksum sidecar cannot be fetched it reports "canonical repository has no checksum sidecar" whatever the cause. Run 45171861093 (2026-11-23) failed that way oncom.google.android:annotations:4.1.1.4, whose.sha1sidecar Maven Central serves (200 when I asked). The log does not hold the HTTP status, so that it was a 429 is likely, not shown.The stand-in repository used for the toy project
The toy project is a
settings.gradle.ktswith a project name and thisbuild.gradle.kts, withdemo:lib:1.0served from the stand-in's directory as a minimal POM and JAR:buildscript { repositories { maven { name = "StandIn" url = uri("http://127.0.0.1:${System.getenv("STANDIN_PORT")}/") isAllowInsecureProtocol = true } } dependencies { classpath("demo:lib:1.0") } }🤖 Generated with Claude Code