GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — http2: finish pending writes after stream close by trivikr · Pull Request #63439 · nodejs/node

Conversation

@trivikr

@trivikr trivikr commented May 19, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

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-writing
  • python3 tools/test.py --repeat=1000 parallel/test-http2-close-while-writing
  • python3 tools/test.py --repeat=10000 parallel/test-http2-close-while-writing

Assisted-by: openai:gpt-5.5

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@nodejs-github-bot

nodejs-github-bot commented May 19, 2026

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/http2
  • @nodejs/net
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@nodejs-github-bot nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. lib / src Issues and PRs involving general changes in the lib/ or src/ directories. needs-ci PRs that need a full CI run. labels May 19, 2026
@trivikr
trivikr force-pushed the flaky-test-http2-close-while-writing-2 branch 2 times, most recently from 2bdb909 to 125b092 Compare May 19, 2026 19:23
@trivikr
http2: finish pending writes after stream close
58e9183
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 <[email protected]>
Assisted-by: openai:gpt-5.5
@trivikr
trivikr force-pushed the flaky-test-http2-close-while-writing-2 branch from 125b092 to 58e9183 Compare May 19, 2026 19:40
@lpinca

lpinca commented May 19, 2026

Copy link
Copy Markdown
Member

See also #63249

As a happy side bonus, as part of this work I hunted down the underlying issue for #58252: buggy cleanup of reset streams.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@codecov

codecov Bot commented May 19, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 88.88889% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 90.06%. Comparing base (0b5b189) to head (58e9183).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/node_http2.cc 84.61% 0 Missing and 2 partials ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main   #63439   +/-   ##
=======================================
  Coverage   90.06%   90.06%           
=======================================
  Files         714      714           
  Lines      225918   225931   +13     
  Branches    42734    42739    +5     
=======================================
+ Hits       203464   203480   +16     
- Misses      14232    14233    +1     
+ Partials     8222     8218    -4     
Files with missing lines Coverage Δ
lib/internal/http2/core.js 95.19% <100.00%> (+<0.01%) ⬆️
src/node_http2.h 91.71% <ø> (+0.09%) ⬆️
src/node_http2.cc 82.09% <84.61%> (+<0.01%) ⬆️

... and 29 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@trivikr trivikr closed this May 19, 2026
@trivikr
trivikr deleted the flaky-test-http2-close-while-writing-2 branch May 27, 2026 07:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

c++ Issues and PRs that require attention from people who are familiar with C++. lib / src Issues and PRs involving general changes in the lib/ or src/ directories. needs-ci PRs that need a full CI run.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

parallel/test-http2-close-while-writing is flaky

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@trivikr @nodejs-github-bot @lpinca
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.