fix(http2): preserve accepted streams after GOAWAY by trivikr · Pull Request #5090 · nodejs/undici (original) (raw)

@trivikr

Assisted-by: openai:gpt-5.4 Signed-off-by: Kamat, Trivikram 16024985+trivikr@users.noreply.github.com

@trivikr mentioned this pull request

Apr 22, 2026

@trivikr

@trivikr

mcollina

metcoder95

mcollina

metcoder95

@trivikr trivikr deleted the http2-graceful-goaway branch

April 28, 2026 03:45

This was referenced

Apr 28, 2026

mcollina pushed a commit that referenced this pull request

Jun 11, 2026

@DucMinhNe

When two requests are multiplexed on one HTTP/2 session and one stream is closed by the server before response headers, finalizeRequest(true) unconditionally reset kPendingIdx back to kRunningIdx while the other request was still in flight. Once the surviving request finalized, kRunningIdx advanced past kPendingIdx, leaving a nulled queue slot that Client[kDestroy] later splices and calls errorRequest on, crashing the process with 'TypeError: Cannot read properties of null (reading 'onResponseError')'.

Only reset kPendingIdx when it has actually fallen behind kRunningIdx, which is the invariant the reset was added to restore in #5090.

Fixes: #5404

Signed-off-by: Minh Le ducminhldm@gmail.com

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

[ Show hidden characters]({{ revealButtonHref }})