Repository navigation
Commit 27586ee
authored
fix(h2): do not rewind kPendingIdx past in-flight requests (#5408)
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>1 parent ac5394b commit 27586ee
2 files changed
Lines changed: 41 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
744 | 744 | | |
745 | 745 | | |
746 | 746 | | |
747 | | - | |
| 747 | + | |
748 | 748 | | |
749 | 749 | | |
750 | 750 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
0 commit comments