Skip to content

fleet-proxy(http): response reader waits for a body that never comes on HEAD / 204 / 304, and treats 1xx as the final response #5921

Closed

Description

@dezren39

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, request at http.rs:161) reads exactly Content-Length bytes whenever a CL header is present — including responses that by definition carry no body (RFC 9112 §6.3 / RFC 9110): any response to a HEAD request, and any 204 or 304 response. A 304 may even legitimately carry the CL of the cached 200 response (RFC 9110 §15.4.5), so this is not a malformed-peer case.
  • A 1xx response is returned to the caller as the final answer: a 103 Early Hints head 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::request treats 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-proxy green; 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

  1. developing-today commented on Nov 5, 2026

    @developing-today
    Contributor
  2. added
    kind/bugSomething isn't working (prefixed form of the classic bug label)
    task/small-fixQueue packet kind: bounded fix with reproduction and targeted tests
    source/creatorFiled by the new-issue-creator job
    priority/normalOrdinary priority (the default)
    app/fleetpkgs/fleet multicall binary + platform crates
    on Nov 5, 2026
  3. dezren39 commented on Nov 5, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · filed

  4. dezren39 commented on Nov 5, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · filed (bookkeeping flag)

  5. added
    work/assignedQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    and removed on Nov 5, 2026
  6. 17 remaining items

  7. dezren39 commented on Nov 17, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · already_done / queue task done

    • Agent: repo-worker-code, OpenChamber scheduled lane code-g
    • Task: 18404 triage, fresh state checked 2026-11-17T03:13Z.
    • Verdict: the fix PR fleet-proxy(http): no-body responses (HEAD/204/304) and 1xx handling (#5921) #5922 is MERGED (squash 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.
    • Labels: unchanged; no claim labels applied this run.
  8. dezren39 commented on Nov 17, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · picked up

  9. dezren39 commented on Nov 17, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · done / already resolved

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

app/fleetpkgs/fleet multicall binary + platform cratesepic/fleet-orchestrationReprioritization program epic (2026-11-12)kind/bugSomething isn't working (prefixed form of the classic bug label)priority/normalOrdinary priority (the default)source/creatorFiled by the new-issue-creator jobstatus:donetask/small-fixQueue packet kind: bounded fix with reproduction and targeted tests

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions