Repository navigation
feat: add TCP linger configuration - #3138
Closed
cfilipescu wants to merge 2 commits into
Closed
cfilipescu wants to merge 2 commits into
cfilipescu wants to merge 2 commits into
Conversation
Author
|
@codex review |
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.
Expose
ClientBuilder::tcp_lingeron the async and blocking clients so applications can configureSO_LINGERon outbound TCP sockets. For example,tcp_linger(Duration::ZERO)opts into abortive close for workloads that otherwise accumulate localTIME_WAITstate. The default isNone, preserving existing behavior.Wrap the existing hyper-util HTTP connector internally and apply the option to the connected TCP stream before TLS or HTTP/SOCKS proxy handshakes. This uses Hyper's supported connector interface and needs no Hyper changes. The wrapper future adds no allocation. Unix sockets, Windows named pipes, and HTTP/3 are unaffected. API documentation describes the data-loss implications of zero linger and potential blocking with nonzero durations.
This PR includes no test changes.
Validation:
blocking,socksenabled: 48 tests passed and two existing tests were ignored.cargo check --features blocking,socksandcargo check --no-default-featurespassed.rustls-no-provider; the implementation is unchanged since those checks.cargo fmt, explicitrustfmtchecks for the changed source files, andgit diff --checkpassed.An additional strict Clippy run reports pre-existing lints in the base branch, including
non_minimal_cfg,multiple_bound_locations, andio_other_error. These unrelated lints are outside this change.