Repository navigation
fix: bound TLS and HTTP setup and reclaim transport resources - #13
Merged
Merged
Conversation
abruption
marked this pull request as ready for review
October 14, 2026 12:35
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Merged
5 tasks
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 #5
Adds 15-second per-stage setup deadlines (absolute for header reads) and a 64 KiB header bound. Covers initial/upstream CONNECT, both TLS handshakes, HTTP response and WebSocket Upgrade. Retains the response deadline through informational 100/103 responses, including coalesced final headers/body. Own sockets before TLS handshake and explicitly shut down/close both endpoints on every exit, including failure to start a worker. Join bridge workers after shutdown; established long-lived streams have blocking timeouts restored. Forward ordinary HTTP upload bodies concurrently while awaiting the first response.
Tests use isolated socket peers and temporary self-signed certificates only. Cover silent peers, TLS stalls, early client EOF while awaiting 101, slow header trickle, oversized headers, failure cleanup, normal uploads, interim-response stalls, idle established raw/WebSocket streams, and existing payload/ping/close/EOF cases. No production fault injection, service or network changes.
Local: 33 shim tests pass; full 66-test suite has only the pre-existing sandbox AF_UNIX permission error (65 pass). CI runs the complete suite on Python 3.11/3.13 and ShellCheck. Independent branch based on main; no dependency on PR #12.
Scope: deadlines bound network setup stages; DNS resolver and local certificate-generation latency are not a global connection-setup SLA. A client that disconnects while awaiting upstream 101 is reclaimed by the bounded Upgrade deadline.
Verified CI on head
8713429ac9052461c6432f5af4784dce674f1507: Python 3.11 and 3.13, 66 tests each, plus Bash syntax and ShellCheck passed. Workflow run.