Surface HTTP/2 response resets after buffered data - #1343
Merged
Conversation
Preserve buffered response DATA after RST_STREAM, then raise the terminal stream error instead of reporting clean EOF. Close and unregister the body when the error surfaces. Cover partial bodies across small and compaction-boundary payload sizes.
Ignore a late stream reset after END_STREAM completed the response normally. Add a synchronized wire-level regression that proves a non-NO_ERROR reset cannot discard the buffered complete body.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1343 +/- ##
==========================================
+ Coverage 88.36% 88.38% +0.01%
==========================================
Files 30 30
Lines 11915 11923 +8
==========================================
+ Hits 10529 10538 +9
+ Misses 1386 1385 -1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
A connection failure caused by another multiplexed stream must not invalidate a response that already received END_STREAM. Remove the impossible incomplete-response branch and cover the completed-stream ownership case with a raw two-stream peer.
Assert the terminal GOAWAY error retains the peer last-stream identifier and renders its user-facing message. This pins the typed error contract used by response lifecycle failures.
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
END_STREAMwhen a later reset races inRoot cause
body_read!treatedstream_doneas clean EOF without checking the terminal stream error recorded by the read loop. A response withoutContent-Lengthcould therefore return a truncated prefix as a successful complete body afterRST_STREAM.The reset handler also needed to distinguish normal response completion from error-driven
stream_done. A late reset must not discard a response that already completed normally.Validation
julia --startup-file=no --project=. test/http2_client_tests.jljulia --startup-file=no --project=. test/http_client_transport_tests.jl— 106/106julia --startup-file=no --project=. test/http_retry_tests.jl— 93/93Content-Length, complete responses followed byNO_ERRORorCANCEL, and a completed stream sharing a failed connectionCo-authored by Codex