http2: finish pending writes after stream close#63439
Open
trivikr wants to merge 1 commit into
Open
Conversation
Collaborator
|
Review requested:
|
2bdb909 to
125b092
Compare
Flush pending Http2Stream write callbacks when nghttp2 closes the stream but JS keeps it alive to finish readable-side cleanup. Also avoid queueing additional writes once the stream is closed. Fixes: nodejs#58252 Signed-off-by: Kamat, Trivikram <16024985+trivikr@users.noreply.github.com> Assisted-by: openai:gpt-5.5
125b092 to
58e9183
Compare
Member
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.
This fixes a race where an HTTP/2 stream can close while writes are still
queued. In that state, pending write callbacks could be left unresolved, which
kept the test process alive until timeout.
The fix completes pending write callbacks when nghttp2 closes the stream and
prevents additional data from being queued once the stream is closed.
The existing regression test now also verifies that all server-side write
callbacks run before the stream closes.
Fixes: #58252
Tested with:
python3 tools/test.py parallel/test-http2-close-while-writingpython3 tools/test.py --repeat=1000 parallel/test-http2-close-while-writingpython3 tools/test.py --repeat=10000 parallel/test-http2-close-while-writingAssisted-by: openai:gpt-5.5