Repository navigation
Conversation
When a peer initiates an RFC 9113 §6.8 two-step graceful shutdown by sending GOAWAY(2^31-1) followed by a PING, poll2() previously buffered the PING ACK via poll_ready() before poll() called streams.poll_complete(). Any request already accepted by send_request() and waiting in the send buffer could therefore be written after the PING ACK, causing the server to commit a lower last_stream_id and refuse the in-flight stream. Flush streams.poll_complete() before send_pending_pong() when a peer GOAWAY has been received and a pong is pending, while preserving normal PING ACK priority when no GOAWAY has been received.
magnet
marked this pull request as ready for review
November 28, 2026 13:35
This branch has not been deployed
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.
When a server starts the two-step graceful shutdown from RFC 9113 section 6.8, it sends GOAWAY(2^31-1) then a PING, and picks the final last_stream_id once the PING ACK comes back. If the client had already queued a request with
send_request()before it read those frames,poll_ready()writes the PING ACK beforepoll_complete()flushes the queued HEADERS. The server then sees the ACK first, sets a last_stream_id below the new stream, and refuses a request that was sent before the shutdown was seen.The first commit adds
queued_request_flushes_before_shutdown_ping_ack, which fails on master: the mock server receives the PING ACK where it expects HEADERS for stream 1. The second commit flushes queued streams before the pending pong, only when a GOAWAY from the peer has been received. Without a GOAWAY, PING ACKs keep their usual priority.