Skip to content

fix: filter stream initiator in recv_go_away (#885)#886

Merged
seanmonstar merged 1 commit intohyperium:masterfrom
ofek-sha:master
Mar 31, 2026
Merged

fix: filter stream initiator in recv_go_away (#885)#886
seanmonstar merged 1 commit intohyperium:masterfrom
ofek-sha:master

Conversation

@ofek-sha
Copy link
Copy Markdown
Contributor

recv_go_away closes all streams with id > last_stream_id, regardless of which endpoint initiated them. When a client sends GOAWAY(0) to a server, client-initiated streams (e.g. stream 1) are incorrectly closed, killing in-progress response bodies before any DATA frames are sent.

Add peer.is_local_init(stream.id) check so only locally-initiated streams above last_stream_id are closed, per RFC 9113 Section 6.8.

Added test client_goaway_does_not_kill_remote_initiated_streams that verifies the server completes a streaming response body on stream 1 after receiving client GOAWAY(NO_ERROR, last_stream_id=0). The test fails without the fix and passes with it.

recv_go_away closes all streams with id > last_stream_id, regardless
of which endpoint initiated them. When a client sends GOAWAY(0) to a
server, client-initiated streams (e.g. stream 1) are incorrectly
closed, killing in-progress response bodies before any DATA frames
are sent.

Add peer.is_local_init(stream.id) check so only locally-initiated
streams above last_stream_id are closed, per RFC 9113 Section 6.8.

Added test client_goaway_does_not_kill_remote_initiated_streams that
verifies the server completes a streaming response body on stream 1
after receiving client GOAWAY(NO_ERROR, last_stream_id=0). The test
fails without the fix and passes with it.
Copy link
Copy Markdown
Member

@seanmonstar seanmonstar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice job investigating, thanks so much!

@seanmonstar seanmonstar merged commit f5f1594 into hyperium:master Mar 31, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants