Skip to content

http: couple fetch() receive backpressure to JS body consumption (h1/h2/h3)#29831

Open
robobun wants to merge 46 commits into
mainfrom
farm/0a9cea98/h2-window-update-backpressure
Open

http: couple fetch() receive backpressure to JS body consumption (h1/h2/h3)#29831
robobun wants to merge 46 commits into
mainfrom
farm/0a9cea98/h2-window-update-backpressure

ci: retrigger gate (release WebKit now prefetched)

08198eb
Select commit
Loading
Failed to load commit list.
Claude / Claude Code Review completed May 2, 2026 in 25m 27s

Code review found 1 important issue

Found 5 candidates, confirmed 1. See review comments for details.

Details

Severity Count
🔴 Important 1
🟡 Nit 0
🟣 Pre-existing 0
Severity File:Line Issue
🔴 Important src/http.zig:2073 Chunked-encoding framing overhead accumulates in outstanding_body_bytes, can deadlock paused socket

Annotations

Check failure on line 2073 in src/http.zig

See this annotation in the file changed.

@claude claude / Claude Code Review

Chunked-encoding framing overhead accumulates in outstanding_body_bytes, can deadlock paused socket

For `Transfer-Encoding: chunked` responses this counts raw wire bytes (chunk-size hex line + CRLFs) into `outstanding_body_bytes`, but `consumeResponseBody` only ever subtracts the de-chunked body bytes that `didDrain` reports — so the per-chunk framing overhead accumulates as a permanent floor. Once that floor exceeds `receive_body_low_water` (256 KiB), any pause becomes permanent and a long-running uncompressed chunked stream (e.g. SSE over HTTP/1.1 read via `res.body.getReader()`) deadlocks.