Skip to content

Reclaim cancelled requests' stranded CONNECTING pool slots - #8

Merged
Jacob-Met merged 1 commit into
masterfrom
fix/reclaim-cancelled-connecting-pool-gpt6-mwjix
Nov 16, 2026
Merged

Jacob-Met merged 1 commit into
masterfrom
fix/reclaim-cancelled-connecting-pool-gpt6-mwjix

Conversation

@Jacob-Met

Copy link
Copy Markdown
Owner

Visible failure

A queued HTTP/1.1 request cancelled after assignment strands a new CONNECTING connection. After enough cancellations, a healthy pool becomes permanently full and callers get PoolTimeout until restart (encode#1093).

Change

Port the already-proposed upstream fix encode#1099 to this fork, integrating its orphan cleanup with existing retired connections and lazy idle probes. Credit to upstream author wwmanidumaneesha; no duplicate upstream PR is needed.

Checks

  • Targeted regression failed before and passed after.
  • Full Python tests: 272 passed, six inherited XPASS.
  • Ruff and mypy package passed.
  • Built wheel, installed into a clean environment, cold regression passed.
  • Healthy 2000-request performance remains within a few percent of current fork.

Next

Upstream PR encode#1099 remains open. Preserve this in fork and adopt upstream once merged.

Port upstream encode#1099 into the fork's retired-connection and lazy-idle-probe lifecycle. A task cancelled after pool assignment can otherwise strand a never-started CONNECTING connection until requests permanently time out.

The issue-1093 regression fails before the fix and passes after. Full suite: 272 passed, 6 inherited xpasses; packaged-wheel cold test, mypy package, and Ruff passed.

Original approach and regression adapted from encode#1099

Co-authored-by: wwmanidumaneesha <manidumaneeshaww@gmail.com>
@Jacob-Met
Jacob-Met merged commit 63b1a2c into master Nov 16, 2026
@Jacob-Met
Jacob-Met deleted the fix/reclaim-cancelled-connecting-pool-gpt6-mwjix branch November 16, 2026 17:47
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