Deliver a promised stream's response HEADERS received after GOAWAY#192
Open
const86 wants to merge 1 commit into
Open
Deliver a promised stream's response HEADERS received after GOAWAY#192const86 wants to merge 1 commit into
const86 wants to merge 1 commit into
Conversation
On receiving GOAWAY the connection moves to :closed, after which #receive dropped every inbound HEADERS frame - including the response HEADERS of a stream the peer promised to finish (id <= last_stream_id). That stream's DATA frames were still delivered (the DATA branch has no :closed guard), so the consumer saw a malformed, headerless response and the request was lost. RFC 9113 Section 6.8 says a receiver of GOAWAY may still complete streams at or below last_stream_id. Only discard HEADERS that would open a NEW stream (id not already in @streams); keep delivering an in-flight stream's response. This bites whenever a server emits GOAWAY just ahead of the response on the same connection - e.g. golang.org/x/net/http2 graceful shutdown - which loses responses the server actually processed and put on the wire. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
On receiving GOAWAY the connection moves to :closed, after which #receive dropped every inbound HEADERS frame - including the response HEADERS of a stream the peer promised to finish (id <= last_stream_id). That stream's DATA frames were still delivered (the DATA branch has no :closed guard), so the consumer saw a malformed, headerless response and the request was lost.
RFC 9113 Section 6.8 says a receiver of GOAWAY may still complete streams at or below last_stream_id. Only discard HEADERS that would open a NEW stream (id not already in @streams); keep delivering an in-flight stream's response.
This bites whenever a server emits GOAWAY just ahead of the response on the same connection - e.g. golang.org/x/net/http2 graceful shutdown - which loses responses the server actually processed and put on the wire.