Skip to content

http2: emit session close before stream close#63414

Open
mcollina wants to merge 1 commit into
nodejs:mainfrom
mcollina:fix-http2-session-close-order-63412
Open

http2: emit session close before stream close#63414
mcollina wants to merge 1 commit into
nodejs:mainfrom
mcollina:fix-http2-session-close-order-63412

Conversation

@mcollina
Copy link
Copy Markdown
Member

@mcollina mcollina commented May 18, 2026

Fixes: #63412

This changes the HTTP/2 session shutdown path so that when the transport has
already been closed, the client session 'close' event is queued before stream
close callbacks are scheduled.

That gives clients a race-free chance to invalidate cached
ClientHttp2Session instances before stream 'close' handlers try to reuse
that session and synchronously hit ERR_HTTP2_INVALID_SESSION.

@nodejs-github-bot
Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/http2
  • @nodejs/net

PR-URL: nodejs#63414
Signed-off-by: Matteo Collina <hello@matteocollina.com>
@nodejs-github-bot nodejs-github-bot added http2 Issues or PRs related to the http2 subsystem. needs-ci PRs that need a full CI run. labels May 18, 2026
@mcollina mcollina force-pushed the fix-http2-session-close-order-63412 branch from 94d6b49 to 0984bca Compare May 18, 2026 17:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

http2 Issues or PRs related to the http2 subsystem. needs-ci PRs that need a full CI run.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

http2: ClientHttp2Session can be invalid before close event is emitted

2 participants