Repository navigation
fix(http1): refuse a non-blocking chunk from the outbound depth (#179) - #214
Merged
Merged
Conversation
Contributor
CoverageTotal lines: 82.46% → 82.73% (+0.27 pp)
|
EdmondDantes
force-pushed
the
179-serialized-h1-outbound
branch
from
August 22, 2026 09:07
9a1a41f to
ad2c0ec
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #179.
tryWrite()answered true on every offer and parked the handler inside thewrite, so the "refused — do something else" branch of a handler was dead code
on HTTP/1.
The fix splits the two callers rather than moving the whole path off the await.
write()keepshttp_connection_send_strv_awaited, and with it the returnvalue that sets
stream_dead, the bracketed write deadline and the copy-freeframe — the three things
dev/BENCHMARKS.mdand the #211 ruling refused togive up.
tryWrite()queues its frame on the connection's outbound tail and isrefused once the depth reaches
setStreamWriteBufferBytes.The depth is the tail plus the write in flight. Counting only the tail reads
zero for the whole first write, so the refusal arrives one write late and the
memory a slow peer pins is twice the knob.
Two things the awaited path had been providing came with the queued one:
completion, and a fire-and-forget completion carries no status, so EPIPE was
invisible. The read side now latches
write_failedand wakes anyone parkedon the tail;
is_alive, the terminator andsend_rawall read it, so a bodythat failed is not sealed as one that finished.
is armed when a non-blocking frame is submitted and stopped when the tail
goes idle, so a peer that stops reading can no longer pin the connection
through the destroy that defers on
out_in_flight.Evidence
h1/053is restored frome5f91a1^, the commit that deleted it in #177because HTTP/1 could not refuse: 42 chunks accepted against a peer that never
reads, the 43rd refused, the handler still running rather than parked.
h1/032changes: it answers a refusal withawaitWritable(). The twins neversuspend, and a loop that only offers never gives the reactor the turn in which
the peer's RST arrives — the test's 499 rested on the hidden park this change
removes, and now rests on the yield a handler actually makes.
Full suite 461 tests, 438 passed, 0 failed, 0 warned, 23 skipped on absent tool
gates, two runs;
ctest16 of 16.The design was attacked before it was written; the findings that shaped it are
the peer-gone latch, the tail deadline and the in-flight byte count above.