Skip to content

fix(endpoint): mount retry adapter for https:// so 408/429 are retried - #671

Open
pcbeingused333 wants to merge 1 commit into
runpod:mainfrom
pcbeingused333:fix/endpoint-retry-https
Open

pcbeingused333 wants to merge 1 commit into
runpod:mainfrom
pcbeingused333:fix/endpoint-retry-https

Conversation

@pcbeingused333

Copy link
Copy Markdown

Fixes a bug where RunPodClient never retries on 408/429.

Root cause: RunPodClient.__init__ builds Retry(total=5, backoff_factor=1, status_forcelist=[408, 429]) but mounts the adapter only on http://. The default endpoint base URL is https://api.runpod.ai/v2, so requests go through requests.Session's default https:// adapter, which has no retry policy. The configured retries were never applied.

Fix: mount the same HTTPAdapter on both http:// and https:// (the same pattern other helpers in the repo already use).

Test: test_retry_adapter_mounted_for_http_and_https checks that the adapter for both schemes carries the retry policy. It fails on main (the https adapter has max_retries.total == 0) and passes with the fix; tests/test_endpoint/test_runner.py goes from 25 passed + 1 failed to 26 passed.

Note: urllib3's default allowed_methods only retries idempotent verbs on status codes, so this affects GET calls such as status/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.

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

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant