Repository navigation
fix(h2): unref a session detached by GOAWAY with no open streams - #5960
Merged
mcollina merged 1 commit intoOct 5, 2026
Merged
Conversation
Merged
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.
This relates to...
Regression from #5839
resumeH2(#5839): keeps the session ref'd while requests are queued.onHttp2SessionGoAway(this PR): unrefs the session detached byGOAWAYwhen it has no open streams.Rationale
When the peer advertises
SETTINGS_MAX_CONCURRENT_STREAMS = 0, requests are queued without a stream.After the peer sends
GOAWAY, the session is detached but never unref'd, so it keeps the process alive.Changes
lib/dispatcher/client-h2.js:onHttp2SessionGoAway()unrefs the detached session if it has no open streamstest/http2-max-concurrent-streams-zero-unref.js: the peer sendsGOAWAYwhile a request is queued. The child must exit after the request completesBug Fixes
GOAWAYwith no open streams is now unref'dTests (Node 24.20.0)
npm run lintnpm run test:h2:core(122/122)npx borp -p "test/http2-max-concurrent-streams-zero-unref.js"(3/3,main 2/3)Assisted-by: Claude Code
Status