Repository navigation
fix(endpoint): mount retry adapter for https:// so 408/429 are retried - #671
Open
pcbeingused333 wants to merge 1 commit into
Open
pcbeingused333 wants to merge 1 commit into
pcbeingused333 wants to merge 1 commit into
Conversation
RunPodClient built a Retry policy (total=5, status_forcelist=[408, 429]) but only mounted it on http://. The default endpoint base URL is https://, so requests.Session fell back to its default adapter and never retried. Signed-off-by: Alex Castillo <alex.castillog33@gmail.com>
This branch has not been deployed
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.
Fixes a bug where
RunPodClientnever retries on 408/429.Root cause:
RunPodClient.__init__buildsRetry(total=5, backoff_factor=1, status_forcelist=[408, 429])but mounts the adapter only onhttp://. The default endpoint base URL ishttps://api.runpod.ai/v2, so requests go throughrequests.Session's defaulthttps://adapter, which has no retry policy. The configured retries were never applied.Fix: mount the same
HTTPAdapteron bothhttp://andhttps://(the same pattern other helpers in the repo already use).Test:
test_retry_adapter_mounted_for_http_and_httpschecks that the adapter for both schemes carries the retry policy. It fails on main (the https adapter hasmax_retries.total == 0) and passes with the fix;tests/test_endpoint/test_runner.pygoes from 25 passed + 1 failed to 26 passed.Note: urllib3's default
allowed_methodsonly retries idempotent verbs on status codes, so this affects GET calls such asstatus/stream; POST (run) behaviour is unchanged by this PR.Disclosure: prepared with the help of an AI assistant (Claude). The new test fails on main and passes with this change.