You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fleet-dispatch response-head read is bounded by bytes but not repetition; timeouts set with .ok() #13466
Socket timeouts are set with .ok() (~201-202), so a failed set_read_timeout/set_write_timeout is silently ignored and the read runs unbounded.
Ask: bound header-line repetition in the dispatch head read to match the http.rs contract, and surface timeout-set failures as errors instead of .ok(). Test both with a stalled and a header-flooding peer.
Verdict: CONFIRMED at main f3e19dcf747 (clean checkout, 2026-11-23). Both gaps are live:
read_response head loop (pkgs/fleet/crates/fleet-dispatch/src/lib.rs ~234-250) breaks only on \r\n\r\n or the 1 MiB byte cap — no header-line count, so a peer of small lines floods freely. The framing validation that follows only inspects Content-Length/Transfer-Encoding lines, so flood lines pass through silently.
open_stream direct path (~201-202) sets both socket timeouts with .ok() — a failed set is swallowed and the 300s/60s deadlines silently vanish.
No open PR covers it (fresh gh pr list search for 13466/fleet-dispatch: only an unrelated dependabot bump). Baseline cargo test -p fleet-dispatch --lib is 16/16 green.
Routing: fix packet enqueued as task 21386 (queue repo-health-code-pilot, kind small_fix, canonical key repo-health:v1:fix:developing-today/code:issue:13466): named MAX_HEADER_LINES bound (256, matching fleet-proxy/src/http.rs :88) in the head loop + transport errors from timeout-set failures, with flood/stalled/timeout-failure tests. Scope keeps http.rs and fleet-dispatch accepts invalid or truncated HTTP response framing #8433 framing untouched.
Scope: bound header-line repetition in the dispatch head read to match the http.rs contract (256 lines); surface timeout-set failures as errors instead of .ok(); add tests with a header-flooding peer and a timeout-set failure path where reachable.
Ownership check: body + all comments read (2 comments, count-confirmed): one Kaneo link, one triage note (oc-code-08, task 21381) confirming the premise and enqueueing the fix — no lane claim, no open PR covering this issue.
What changed (pkgs/fleet/crates/fleet-dispatch/src/lib.rs only):
The read_response head loop now counts complete lines as they arrive and refuses past the fleet-proxy http.rs contract — fleet_proxy::http::MAX_HEADER_LINES (256), referenced directly from fleet-proxy so the two readers share one constant and cannot drift. Header lines are counted after the status line, excluding the blank terminator line.
open_stream's .ok() timeout sets are gone: both go through a new apply_timeouts helper that maps a failed set_read_timeout/set_write_timeout to a transport error naming the failed deadline.
header_flooding_peer_is_refused — 257 header lines refused ("head exceeds 256 header lines") though far under the 1 MiB byte cap; a control head at exactly 256 header lines is accepted.
stalled_peer_times_out_instead_of_hanging — a peer that accepts and never sends fails the read at its 200 ms deadline.
timeout_set_failures_surface_as_errors — a zero duration (refused by the OS layer) surfaces as a transport error; the success path reads back the timeouts it set.
Verification:cargo test -p fleet-dispatch on the laptop (sccache disabled per sccache daemon wedges specific in-flight Rust compiles on the laptop (clients park at 0% CPU; daemon stays responsive) #13367, private target dir): 19 passed / 0 failed, both at the branch head and again at the merge commit on main. cargo fmt --check clean. Clippy under the rustup 1.99.1 toolchain (the repo pin; the laptop's default clippy/rustc pair is version-split and cannot build this workspace — pre-existing environment state): no new warnings in the touched crate.
Issue criteria: both asks implemented and tested as specified. Closing.
Activity
developing-today commentedon Nov 23, 2026
CODE-4909
dezren39 commentedon Nov 23, 2026
🤖 Agent note · triaged — confirmed live, fix enqueued
repo-health-code-pilot· kindtriagef3e19dcf747(clean checkout, 2026-11-23). Both gaps are live:read_responsehead loop (pkgs/fleet/crates/fleet-dispatch/src/lib.rs~234-250) breaks only on\r\n\r\nor the 1 MiB byte cap — no header-line count, so a peer of small lines floods freely. The framing validation that follows only inspects Content-Length/Transfer-Encoding lines, so flood lines pass through silently.open_streamdirect path (~201-202) sets both socket timeouts with.ok()— a failed set is swallowed and the 300s/60s deadlines silently vanish.gh pr listsearch for 13466/fleet-dispatch: only an unrelated dependabot bump). Baselinecargo test -p fleet-dispatch --libis 16/16 green.repo-health-code-pilot, kindsmall_fix, canonical keyrepo-health:v1:fix:developing-today/code:issue:13466): namedMAX_HEADER_LINESbound (256, matchingfleet-proxy/src/http.rs:88) in the head loop + transport errors from timeout-set failures, with flood/stalled/timeout-failure tests. Scope keepshttp.rsand fleet-dispatch accepts invalid or truncated HTTP response framing #8433 framing untouched.fix(fleet-dispatch): bound response-head repetition and surface timeo…
dezren39 commentedon Nov 23, 2026
🤖 Agent note · claimed — lane AAR
pkgs/fleet/crates/fleet-dispatch/src/lib.rs:open_streamsets read/write timeouts with.ok()(~lines 201-202), and theread_responsehead loop is bounded only by the 1 MiB byte cap — no header-line count. The fleet-proxy http.rs contract caps repetition atMAX_HEADER_LINES = 256(fleet-proxy(http): response reader caps every line but nothing caps repetition — endless 1xx heads, header lines, or trailer lines hang an exchange (and its pooled tunnel) forever #6509)..ok(); add tests with a header-flooding peer and a timeout-set failure path where reachable.agent-note:v1
fix(fleet-dispatch): bound response-head repetition, surface timeout-…
dezren39 commentedon Nov 23, 2026
🤖 Agent note · done — lane AAR
5f2cc825bcb142a3621944b0b098e989a9eaf4b5(branch headcd739b5b408).pkgs/fleet/crates/fleet-dispatch/src/lib.rsonly):read_responsehead loop now counts complete lines as they arrive and refuses past the fleet-proxy http.rs contract —fleet_proxy::http::MAX_HEADER_LINES(256), referenced directly from fleet-proxy so the two readers share one constant and cannot drift. Header lines are counted after the status line, excluding the blank terminator line.open_stream's.ok()timeout sets are gone: both go through a newapply_timeoutshelper that maps a failedset_read_timeout/set_write_timeoutto a transport error naming the failed deadline.header_flooding_peer_is_refused— 257 header lines refused ("head exceeds 256 header lines") though far under the 1 MiB byte cap; a control head at exactly 256 header lines is accepted.stalled_peer_times_out_instead_of_hanging— a peer that accepts and never sends fails the read at its 200 ms deadline.timeout_set_failures_surface_as_errors— a zero duration (refused by the OS layer) surfaces as a transport error; the success path reads back the timeouts it set.cargo test -p fleet-dispatchon the laptop (sccache disabled per sccache daemon wedges specific in-flight Rust compiles on the laptop (clients park at 0% CPU; daemon stays responsive) #13367, private target dir): 19 passed / 0 failed, both at the branch head and again at the merge commit on main.cargo fmt --checkclean. Clippy under the rustup 1.99.1 toolchain (the repo pin; the laptop's default clippy/rustc pair is version-split and cannot build this workspace — pre-existing environment state): no new warnings in the touched crate.agent-note:v1