fix: harden connection lifecycle, connect budgets, and follow-up paths#74
Merged
Merged
Conversation
Close production-readiness gaps from the deep review: pool eviction now aborts owned hyper tasks and clears bindings, connect_timeout covers TLS and protocol binding, HTTP/2 temporary unreadiness no longer parks on the wrong wait signal, follow-ups drain intermediate bodies and strip body headers on method-changing redirects, decompression failures force connection discard, and WebSocket engines honor size limits without request-path panics.
Resolve workspace clippy issues under `-D warnings` (field reassignment with Default, collapsible match, unused mut) and apply rustfmt across touched crates.
fannnzhang
added a commit
that referenced
this pull request
Jul 11, 2026
Build on the rebased pool sharding work: - Capture follow-up RequestSnapshot headers/extensions only when redirects, retries, or authenticators can rebuild the request (light mode for single-shot). - Default clients use CachingDnsResolver (30s positive / 5s negative TTL) over the system resolver to cut repeated lookups under connection churn. - Hold request-admission permits via response extensions into CallLifecycleBody, removing an extra BoxBody wrapper on returned responses. Also merges pool sharding with the #74 eviction-hook teardown path.
6 tasks
fannnzhang
added a commit
that referenced
this pull request
Jul 11, 2026
* perf: shard the connection pool and cut hot-path allocations Reduce lock contention and cloning on the request hot path: - Shard the connection pool by address hash (32 shards) with a shared coalescing index so multi-host acquire/release no longer serializes on one global mutex. - Share a single Arc<Address> across dual-stack / multi-endpoint route plans. - Store follow-up RequestSnapshot headers and extensions behind Arc so auth and retry rebuilds avoid repeated full-map clones when only metadata is used. - Reclaim ResponseBody::text() buffers via Bytes::into() when uniquely owned. * perf: lazy snapshots, DNS cache, and thinner response body path Build on the rebased pool sharding work: - Capture follow-up RequestSnapshot headers/extensions only when redirects, retries, or authenticators can rebuild the request (light mode for single-shot). - Default clients use CachingDnsResolver (30s positive / 5s negative TTL) over the system resolver to cut repeated lookups under connection churn. - Hold request-admission permits via response extensions into CallLifecycleBody, removing an extra BoxBody wrapper on returned responses. Also merges pool sharding with the #74 eviction-hook teardown path.
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.
Summary
Implements the high-priority production-hardening items from the deep network-stack review:
connect_timeoutnow covers TLS handshake and protocol binding (direct + proxy tunnel paths), not only TCP.SendRequestunreadiness no longer treats the connection as pool-Busy and waits on the wrong signal; callers awaitready()under the call path.Content-Encoding,Transfer-Encoding,Expect, etc.).getrandompaths;openwire-tungstenitehonorsmax_frame_size/max_message_size.is_end_stream() == true.Test plan
cargo test -p openwire --lib --all-featurescargo test -p openwire --test integration --all-featurescargo test -p openwire-core --libcargo test -p openwire-tungstenite --all-featuresNotes
Pool sharding / lazy
RequestSnapshothot-path perf work was intentionally deferred to keep this PR focused on correctness and resource lifecycle. Follow-up PRs can take that on separately.