Phase 5: streaming edge cases - #18
Open
Piyush-Goenka wants to merge 1 commit into
Open
Conversation
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.
Summary
Closes out the remaining edge cases from the streaming behavior matrix.
HEAD request body suppression
A HEAD request to a
call(stream)endpoint previously started chunked framing and sent body chunks, violating RFC 9110 and desyncing keep-alive clients. The callable is now never invoked (mirroring Rack::Head): the body is closed if it responds tocloseand the response completes headers-only.GC safety for RackStream
RackStreamheld its C context as a raw pointer with no free function, so a stream dropped withoutcloseleaked the context and left the connection wedged in streaming mode until the client gave up. The class now uses TypedData with a finalizer that finishes the response when the connection is still alive. Testing this exposed a second issue: the stream's last reference could survive in a machine-stack slot and get pinned by the conservative GC scan, so the slot is now explicitly cleared after the callable returns.Tests
Three new integration specs (HEAD suppression, keep-alive reuse after HEAD, GC collection finishing an abandoned stream). Full suite: 128 examples, 0 failures.
A full audit of the 35-case behavior matrix (evidence per case) was done as part of this work.