Repository navigation
Conversation
|
Review requested:
|
close() with NO_ERROR waits for 'finish' before sending RST_STREAM. If the body is stuck behind flow control and the stream is destroyed first, RST_STREAM is never sent and nghttp2 keeps the stream open. On the next WINDOW_UPDATE, OnRead finds no stream and returns 0 without EOF, so nghttp2 sends empty DATA frames until OOM. Both client and server streams are affected. Send the deferred RST_STREAM in _destroy(). As a backstop, return NGHTTP2_ERR_TEMPORAL_CALLBACK_FAILURE from OnRead when the stream is gone, which nghttp2 documents as the way to reset a stream on error. Fixes: nodejs#67363 Signed-off-by: inoway46 <[email protected]>
5708532 to
7288a16
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #67372 +/- ##
==========================================
- Coverage 92.62% 90.71% -1.91%
==========================================
Files 430 798 +368
Lines 196333 280032 +83699
Branches 29897 53860 +23963
==========================================
+ Hits 181849 254038 +72189
- Misses 14159 16283 +2124
- Partials 325 9711 +9386
🚀 New features to boost your workflow:
|
|
I tested this against the production case in nodejs/undici#6181: a Node 26.12.1 service using With this commit cherry-picked onto
The We are hitting this in production: a Node 26.12.1 service using |
|
Looks like we'll need manual backports for this |
raised backports, will rebase them once this is merged. |
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: #67363