Repository navigation
mintSources.py: Don't rank mirrors that return HTTP errors in the speed test - #286
Open
Amadeus-22 wants to merge 1 commit into
Open
Amadeus-22 wants to merge 1 commit into
Amadeus-22 wants to merge 1 commit into
Conversation
…ed test The speed test downloads dists/<codename>/.../Packages.gz (or Contents-amd64.gz) with pycurl but never checks the HTTP status. A mirror which doesn't carry the current release answers 404, curl happily "downloads" the error page, and SPEED_DOWNLOAD reports a positive speed. The mirror is then listed with a speed and can end up at the top of the list, and apt update fails after the user picks it. Set FAILONERROR so HTTP errors raise and the mirror is reported as unreachable, like any other download failure. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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 mirror speed test downloads a test file with pycurl but never checks the HTTP status. A mirror that does not carry the release answers with a 404 page, and the download speed of that error page is reported as the mirror's speed. Such a mirror can sort to the top of the list, and
apt updatethen fails after the user selects it.Setting
pycurl.FAILONERRORmakes HTTP errors raise, so the mirror gets 0 and is shown as "Unreachable". Mirrors that serve the file are measured as before, and the existing unit test still passes.Reproduced with a local mirror that has
ls-lR.gzbut nodists/noble:🤖 Generated with Claude Code