Skip to content

quic: fix infinite loop if STOP_SENDING received on a buffering stream - #64715

Merged
nodejs-github-bot merged 1 commit into
nodejs:mainfrom
pimterry:fix-quic-stream-shut-loopx
Aug 8, 2026
Merged

quic: fix infinite loop if STOP_SENDING received on a buffering stream#64715
nodejs-github-bot merged 1 commit into
nodejs:mainfrom
pimterry:fix-quic-stream-shut-loopx

Conversation

@pimterry

Copy link
Copy Markdown
Member

The HTTP/3 application implements StreamWriteShut to clean up streams after ngtcp2 reports NGTCP2_ERR_STREAM_SHUT_WR (generally when STOP_SENDING is received).

The default application does not. This meant it fell into a busy loop in ngtcp2 where it tried to send the data constantly in a loop forever, blocking the process. Test here reproduces this: the server accepts the stream but never reads, the client writes enough data to end up buffered, the server sends STOP_SENDING => 100% CPU never exits.

The default QUIC app now unschedules the stream when it's shut, which fixes the test.

This is largely independent of #64710. It fails with or without that change. In effect that PR changes the callback & frame-level behaviour around STOP_SENDING, while this one fixes a bug in the low-level writing behaviour for closed stream errors.

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/quic

@nodejs-github-botnodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. needs-ci PRs that need a full CI run. quic Issues and PRs related to the QUIC implementation / HTTP/3. labels Jul 24, 2026
@codecov

codecovBot commented Jul 24, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.12%. Comparing base (6572cf5) to head (c7ecaf2).
⚠️ Report is 239 commits behind head on main.

Additional details and impacted files
@@ Coverage Diff @@## main #64715 +/- ##
==========================================
- Coverage 90.13% 90.12% -0.02% 
==========================================
Files 741 741 Lines 242251 242251 Branches 45615 45624 +9 ==========================================
- Hits 218355 218319 -36 - Misses 15396 15431 +35 - Partials 8500 8501 +1 

see 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.

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@panvapanva added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Aug 8, 2026
@jasnelljasnell added the commit-queue Add this label to land a pull request using GitHub Actions. label Aug 8, 2026
@nodejs-github-botnodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Aug 8, 2026
@nodejs-github-bot
nodejs-github-bot merged commit a876a12 into nodejs:mainAug 8, 2026
94 of 95 checks passed
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Landed in a876a12

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author readyPRs that have at least one approval, no pending requests for changes, and a CI started.c++Issues and PRs that require attention from people who are familiar with C++.needs-ciPRs that need a full CI run.quicIssues and PRs related to the QUIC implementation / HTTP/3.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@pimterry@nodejs-github-bot@jasnell@panva