[v26.x] http2: do not reset stream before END_STREAM is sent #66672
All Vouch review confidence checks passed
Residual risk 0.15 = Change Risk (0.35) × (1 − Review Confidence (0.57)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.35 · 162 lines diff across 2 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.305
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #66672"
general
weight: 0.35
efekrskl
When a compat API response finishes and the request had no body,
kMaybeDestroy() takes the graceful-close path and sends RST_STREAM(NO_ERROR)
right away. If the connection flow-control window is exhausted at that
point, the empty END_STREAM DATA frame is still queued, so the reset goes
out first and END_STREAM is dropped. The client gets the full body but no
END_STREAM, so it treats the response as incomplete.
This skips the graceful close when the request already ended with its
HEADERS frame, since there is no request body to stop.
This targets v26.x-staging because main is not affected: the trailer
changes in #64265 avoid this path, but the v26 backport (#64663) left
them out. I could also reproduce it on v22.16.0, and the issue reports
v24.x too.
Testing:
RST_STREAM(code=0)before the fix,DATA(0B, END_STREAM)after.checks that /small gets END_STREAM before any reset, and that the server
stream still closes on its own.
python tools/test.py "parallel/test-http2-*": 283 passed (Windows x64).Fixes: https://github.com/nodejs/node/issues/66525
Refs: https://github.com/nodejs/node/pull/64265
Refs: https://github.com/nodejs/node/pull/64663