Skip to content

Do not hold on to HTTP/2 connections after receiving GOAWAY without open streams#1566

Merged
timostamm merged 1 commit intomainfrom
tstamm/Don't-hold-on-to-HTTP/2-connections-after-receiving-GOAWAY-without-open-streams
Aug 28, 2025
Merged

Do not hold on to HTTP/2 connections after receiving GOAWAY without open streams#1566
timostamm merged 1 commit intomainfrom
tstamm/Don't-hold-on-to-HTTP/2-connections-after-receiving-GOAWAY-without-open-streams

Conversation

@timostamm
Copy link
Member

If a HTTP/2 client receives a GOAWAY frame, it must not open new streams on the connection. Existing streams can finish, but new streams must use a new connection.

The Http2SessionManager from @connectrpc/connect-node implements this logic. It automatically opens a new connection for new requests, and holds on to the current current, waiting for existing streams to finish. The new connection can also receive a GOAWAY frame, so all such connections are kept in a list of connections that are "shutting down".

So far, so good. But if a connection without any open streams receives a GOAWAY frame, it's also put into the list of shutting down connections, and it's never vacated. This PR changes the behavior for connections without open streams: If they receive a GOAWAY frame, they are not added to the list of shutting down connections.

Fixes #1545.

…en streams

Signed-off-by: Timo Stamm <ts@timostamm.de>
@timostamm timostamm changed the title Don't hold on to HTTP/2 connections after receiving GOAWAY without open streams Do not hold on to HTTP/2 connections after receiving GOAWAY without open streams Aug 28, 2025
@timostamm timostamm requested a review from srikrsna-buf August 28, 2025 10:21
@timostamm timostamm merged commit e1c4728 into main Aug 28, 2025
37 of 39 checks passed
@timostamm timostamm deleted the tstamm/Don't-hold-on-to-HTTP/2-connections-after-receiving-GOAWAY-without-open-streams branch August 28, 2025 11:41
@timostamm timostamm mentioned this pull request Nov 17, 2025
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.

Potential memory leak on client when connection is closed by server (e.g., ALB)

2 participants