Networking: deadline pass across TCP connect, TLS handshake, HTTP request #484
Labels
No labels
bug
dependencies
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
refactor
rust
technical-debt
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
navicore/patch-seq#484
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Networking — deadline pass across TCP / TLS / HTTP
Largest single follow-up from the PR1–PR5 networking arc. Three IO layers each have an unbounded-park hazard today; they want one coherent deadline mechanism rather than three independent ones.
The three hazards
Connect timeout (deferred from PR2 #478)
may::net::TcpStream::connectparks the strand for the full OS SYN timeout (~60–130s on Linux) against a silent peer. No caller-side bound.TLS handshake timeout (deferred from PR3 #479)
ClientConnection::complete_iodrives reads/writes until handshake succeeds, fails, or the peer goes mute forever. Stacks on top of connect timeout — a partly-broken peer can park a strand forSYN_timeout + handshake_indefinite.PR3 reviewer:
HTTP per-request timeout / EOF-framed body hang (deferred from PR4 #480)
No deadline at all. The worst-case shape is a response with neither
Content-Lengthnor chunked encoding: the client reads until EOF, which an attacker-controlled server can stretch indefinitely. Currently documented inSTDLIB_REFERENCE.mdv1 limitations:Why one design, not three
The hazards share machinery: each needs a deadline plumbed through cooperative IO that the may scheduler can use to wake the strand on expiry. The reviewers explicitly grouped them across PR2/3/4:
Open design questions (resolve via
/designbefore any code)crate::time::deadlinehelper, or compose existing strand-cancel mechanisms (strand.weave-canceland friends)?complete_iomay need a wrapping loop that checks deadline between rounds, since rustls itself has no deadline parameter.Rough scope
Multi-PR.
/designcycle to settle the API + the may-aware deadline primitive.net.tcp.connecttimeout (smallest consumer).net.tls.client), then HTTP request (net.http.*) to the same primitive.Probably 1–2 weeks of focused work plus design discussion.
#488