Repository navigation
Conversation
Collaborator
|
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 <inoueyuya416@gmail.com>
inoway46
force-pushed
the
http2-rst-on-destroy-after-close
branch
from
November 10, 2026 06:14
5708532 to
7288a16
Compare
inoway46
marked this pull request as ready for review
November 10, 2026 06:20
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:
|
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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