Retry transient download failures in the validator - #1145
Merged
chcg merged 1 commit intoJul 29, 2026
Conversation
Every run downloads the archive of every plugin in the list, so one dropped connection or gateway timeout on any single entry fails the whole validation and hides the real result. A recent run lost four unrelated plugins at once to ConnectionResetError(10054) from the release CDN, while the same JSON validated fine on the other two platforms. Downloads now go through a session that retries connection errors and the usual transient status codes three times with exponential backoff, and carries a 60 second timeout so a hung host cannot stall the job indefinitely. Permanent failures are unchanged: a host that stays unreachable still raises and a status that stays non-200 is still reported with the existing message, because the retry policy does not raise on status.
Contributor
|
@krotname Thanks for the contribution to stabilise the download checks. Already had this on my list but didn't find the time for it. |
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.
validator.pydownloads the archive of every plugin in the list on every run, with a singlerequests.getthat has no retries and no timeout. One dropped connection on any single entry —including entries the pull request never touched — fails the whole job and hides the real result.
This is not hypothetical: in run 30290736279
the
build (Release, x64)job lost four unrelated plugins at once:All four are hosted on the GitHub release CDN, the job died in
Validate jsonbefore MSBuild everran, and
build (Release, Win32)andbuild (Release, arm64)validated the very same JSON filessuccessfully in the same run. Only a maintainer can re-run the job, so a contributor is stuck
looking at a red check they cannot clear or explain.
Change
Downloads go through a
requests.Sessionwhose adapter retries connection errors and the usualtransient status codes (408, 425, 429, 500, 502, 503, 504) three times with exponential backoff,
plus a 60 second timeout so a hung host cannot stall the job indefinitely.
Error reporting is deliberately unchanged for real failures.
raise_on_status=Falsekeeps apersistently non-200 response flowing into the existing status check with its original message, and
a host that stays unreachable still raises
RequestExceptioninto the existing handler.Worst case cost is bounded: a genuinely dead URL now takes about 12 extra seconds before it is
reported, and a healthy list costs nothing.
Verification
Against a local server that injects faults, using the session built by this change:
ConnectionErrorraised, reported as beforeThe connection resets are real RSTs (
SO_LINGERwith a zero timeout), matching the WinError 10054the runner saw.
python validator.py x86,x64andarm64all exit 0 against currentmasterwith this change,with zero errors reported.
No new dependencies:
requests.adapters.HTTPAdapterships withrequests, andurllib3is alreadypinned in
requirements.txt.