Repository navigation
ngclient: retry transient 502/503/504 responses in Urllib3Fetcher - #3067
Open
ekanshbannsal wants to merge 1 commit into
Open
ekanshbannsal wants to merge 1 commit into
ekanshbannsal wants to merge 1 commit into
Conversation
Signed-off-by: Ekansh Bannsal <ekanshbannsal@gmail.com>
This branch has not been deployed
No deployments
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.
Description of the changes being introduced by the pull request:
Urllib3Fetcherpreviously lefturllib3'sRetry(total=3)defaults in place, which keepstatus_forcelist=set(), so transient502/503/504responses without aRetry-Afterheader (e.g. Google Cloud Storage-backed TUF repositories such as Sigstore) failed immediately without retrying.Urllib3Fetcher._fetchintuf/ngclient/urllib3_fetcher.pyto passretries=urllib3.Retry(total=3, status_forcelist=frozenset({502, 503, 504}), raise_on_status=False)toProxyEnvironment.request(...).raise_on_status=Falsepreserves existingUrllib3Fetchererror semantics so persistent502/503/504responses after retries are exhausted still raiseexceptions.DownloadHTTPErrorwith the HTTP status code.tests/test_fetcher_ng.pyverifying that transient502->503->504->200responses succeed after retries and that persistent504responses raiseDownloadHTTPError(status_code=504)after exhausting retries.python -m unittest,ruff check,ruff format --diff, andmypy.Fixes #3044