http2: send deferred RST_STREAM on stream destroy #67372
All Vouch review confidence checks passed
Residual risk 0.13 = Change Risk (0.32) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.32 · 122 lines diff across 1 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
Shallow Review Depth
shallow_review_depth
0.289
Diff Size
diff_size
0.288
Real PR Conversation Timeline
1 comments
"Review active on #67372"
general
weight: 0.35
pimterry
close()withNO_ERRORwaits for'finish'before sendingRST_STREAM. If the body is stuck behind flow control and the stream is destroyed first,RST_STREAMis never sent and nghttp2 keeps the stream open. On the nextWINDOW_UPDATE,OnReadfinds no stream and returns 0 without EOF, so nghttp2 sends empty DATA frames in a loop until the process runs out of memory.The issue reports this for client requests, but server responses are affected in the same way.
Send the deferred
RST_STREAMin_destroy(). As a backstop, returnNGHTTP2_ERR_TEMPORAL_CALLBACK_FAILUREfromOnReadwhen the stream is gone, which nghttp2 documents as the way to reset a stream on error. Add regression tests for client and server streams.Both tests run out of memory on current main, v22.23.4, v24.22.2 and v26.13.0, and pass with this change.
Fixes: https://github.com/nodejs/node/issues/67363