Repository navigation
Description
fleet-proxy(http): response reader waits for a body that never comes on HEAD / 204 / 304, and treats 1xx as the final response
HttpConn::request in pkgs/fleet/crates/fleet-proxy/src/http.rs decides the response body solely from the framing headers, never from the request method or the status class:
- The body branch (http.rs:268-281,
requestat http.rs:161) reads exactlyContent-Lengthbytes whenever a CL header is present — including responses that by definition carry no body (RFC 9112 §6.3 / RFC 9110): any response to aHEADrequest, and any204or304response. A304may even legitimately carry the CL of the cached 200 response (RFC 9110 §15.4.5), so this is not a malformed-peer case. - A
1xxresponse is returned to the caller as the final answer: a103 Early Hintshead is parsed, its (absent) body read as empty, and(103, "")is returned while the real final response stays in the stream — the pooled connection's next request then parses that stale response as its own (the desync class fleet-proxy(http): response reader trusts peer-declared sizes (unbounded preallocation) and silently drops the body on a malformed Content-Length, desyncing the pooled connection #5579 fixed for malformed CL, through a different door).
Impact: the broker forwards any valid method token (HEAD included — valid_method, http.rs, is the only gate) to laptop services over tunnels whose read timeout is 660 s (TUNNEL_READ_TIMEOUT, pkgs/fleet/crates/fleet-proxy/src/tunnel.rs:22). One HEAD probe or conditional-GET/304 exchange through the proxy stalls the request for the full 660 s, then errors and marks the connection dead; the broker's one fresh-tunnel retry repeats the stall. A 103-emitting service silently returns the wrong status/body and poisons the pooled tunnel for the next caller.
Verification (this run, laptop probe against the real crate)
Probe crate ~/git/fleet/probe-proxy-nobody (path-dep on fleet-proxy @ 83f78ed234, canned loopback peer, client read timeout shortened to 3 s for the probe):
control GET 200 CL5+body: Ok status=200 body="hello" elapsed=4.8ms reusable=true
HEAD 200 CL5 no body: Err Resource temporarily unavailable (os error 11) elapsed=3.00s reusable=false
GET 204 CL5 no body: Err Resource temporarily unavailable (os error 11) elapsed=3.00s reusable=false
GET 304 CL5 no body: Err Resource temporarily unavailable (os error 11) elapsed=3.00s reusable=false
GET 103-then-200: Ok status=103 body="" elapsed=~0s reusable=true (final 200 left in the stream)
Control passes instantly; every no-body shape blocks until the read timeout and kills the connection; the 1xx shape returns the interim response as final with the connection still marked reusable.
Why it matters
The proxy is the fleet's single door to laptop services; health checks (HEAD) and conditional requests (ETag/304) are ordinary HTTP a service or client may emit at any time. Today either one wedges a broker request for ~11 minutes per attempt instead of answering in milliseconds, and a 103 silently corrupts the next pooled exchange. #5579 hardened this reader against peer-declared sizes and #5750 against request-line injection; body existence is the remaining unhandled axis of the same reader.
Acceptance criteria
HttpConn::requesttreats responses to HEAD, and 101/204/304 responses (any 1xx handled per below), as body-less regardless of Content-Length / Transfer-Encoding headers, returning promptly with an empty body and correct reusability (a keep-alive 204/304/HEAD exchange leaves the connection reusable).- 1xx responses (at minimum 100-199 except 101) are consumed and the reader continues to the final response; the final response's status/body are what the caller sees, and no bytes of it remain to desync the pooled connection.
- New pinning tests in http.rs next to the existing canned-peer tests cover: HEAD with CL, 204 with CL, 304 with CL, and a 103→200 sequence (plus the ordinary 200 control still passing).
cargo test -p fleet-proxygreen; the fleet-proxy(http): response reader trusts peer-declared sizes (unbounded preallocation) and silently drops the body on a malformed Content-Length, desyncing the pooled connection #5579 malformed/oversize CL behaviour is unchanged for responses that do carry bodies.
Activity
developing-today commentedon Nov 5, 2026
CODE-1600
dezren39 commentedon Nov 5, 2026
🤖 Agent note · filed
dezren39 commentedon Nov 5, 2026
🤖 Agent note · filed (bookkeeping flag)
fleet queue enqueuecall returned a task-shaped row whose id was cut off in the captured tail; a confirming second call reported "enqueued new task 9819". If a sibling task (likely task 9818) exists with the same dedupe keyrepo-health:v1:fix:developing-today/code:issue:5921, the second claimant should supersede/cancel it — task 9819 is the confirmed packet of record.17 remaining items
dezren39 commentedon Nov 17, 2026
🤖 Agent note · already_done / queue task done
9ddf6a8216). The issue reads OPEN; the fix is landed, so the issue can close with the merge. Left open for the schedule owner to close. No new repo-health task created.dezren39 commentedon Nov 17, 2026
🤖 Agent note · picked up
dezren39 commentedon Nov 17, 2026
🤖 Agent note · done / already resolved