Skip to content

fix: concurrency correctness#515

Open
hydrogen7797 wants to merge 4 commits into
runpod:mainfrom
hydrogen7797:fix/concurrency-correctness
Open

fix: concurrency correctness#515
hydrogen7797 wants to merge 4 commits into
runpod:mainfrom
hydrogen7797:fix/concurrency-correctness

Conversation

@hydrogen7797

Copy link
Copy Markdown

No description provided.

@hydrogen7797 hydrogen7797 marked this pull request as draft June 22, 2026 03:18
@hydrogen7797 hydrogen7797 marked this pull request as ready for review June 22, 2026 03:19
@hydrogen7797 hydrogen7797 reopened this Jun 22, 2026
@deanq deanq changed the title Fix/concurrency correctness fix: concurrency correctness Jun 22, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses correctness issues in HTTP request handling under concurrency (serverless result posting) and improves endpoint client behavior around retries and final-state handling.

Changes:

  • Avoids mutating shared aiohttp session headers by passing X-Request-ID per request when posting serverless results (with matching test updates).
  • Improves endpoint requests.Session retry configuration by mounting retry adapters for both https:// and http:// and expanding retryable status codes.
  • Fixes endpoint final-state logic by adding CANCELLED to FINAL_STATES and making is_completed() reference that constant.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
tests/test_serverless/test_modules/test_http.py Updates assertions to require X-Request-ID header in result/stream POSTs.
runpod/serverless/modules/rp_http.py Passes request ID per request to avoid shared-session header races.
runpod/endpoint/runner.py Updates retry/backoff policy and mounts adapter for HTTPS as well as HTTP.
runpod/endpoint/helpers.py Aligns final-state constants with is_completed() logic (includes CANCELLED).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread runpod/endpoint/runner.py
Comment on lines +47 to +52
retries = Retry(
total=5,
backoff_factor=1,
status_forcelist=[408, 429, 500, 502, 503, 504],
allowed_methods=frozenset(["GET", "POST"]),
)
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.

3 participants