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 — quic: retain readers for readable streams by GiHoon1123 · Pull Request #66407 · nodejs/node

Conversation

@GiHoon1123

@GiHoon1123 GiHoon1123 commented Sep 30, 2026 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Contributor

Fixes: #66347

When a peer-initiated unidirectional stream sent data and FIN before the consumer performed
its first async iterator pull, the native stream could be cleaned up before the reader was
created. The buffered data was then no longer available to the JavaScript stream.

Create the reader when a readable QuicStream is constructed so the underlying data queue
remains available until the consumer pulls from the iterator. Local unidirectional streams
remain unreadable and do not allocate a reader.

This means every readable stream allocates a reader whether or not it's ever read, instead
of only on first pull. #66347 asked whether lazy allocation was the right call for this;
eager allocation is the answer this PR takes to that question.

Added a regression test covering data received before the first iterator pull.

This also preserves buffered incoming data after local session or stream destruction,
even when reading has not started. Updated the teardown tests to wait for the full payload
and check both the retained data and the truncation error. Added coverage for explicit
errors after reading 128 KiB with both truncatedReads policies, and documented this behavior.

Rebased onto main at 763524d and wrapped the commit message to 72 columns.

Validation on macOS:

  • QUIC-enabled Node build
  • python3 tools/test.py --mode=release -j6 -t60 -p tap 'parallel/test-quic*':
    269 passed, 2 skipped (ngtcp2_test_client and ngtcp2_test_server binaries not built)
  • ESLint for the changed JS files and delayed-reader test
  • Markdown lint for doc/api/quic.md

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 Sep 30, 2026

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/quic
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 needs-ci PRs that need a full CI run. quic Issues and PRs related to the QUIC transport implementation. labels Sep 30, 2026
@github-actions

github-actions Bot commented Sep 30, 2026

Copy link
Copy Markdown
Contributor

Welcome to Node.js, and thank you for your first contribution!

Before review, please take a moment to read:

  • the guide for first-time contributors
  • the contribution and automation policies
  • the pull request guide
  • the AI use policy
  • the Code of Conduct

Please make sure every commit is signed off. For a first pull request, GitHub Actions require collaborator approval and Jenkins CI must be started by a collaborator or triager, so an initial wait is normal.

All reactions

Sorry, something went wrong.

Uh oh!

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

@GiHoon1123 GiHoon1123 mentioned this pull request Sep 30, 2026
quic: reader is lazily allocated in QuicStream, an incoming unidi stream with fin will loose its data #66347
Closed
@MikeMcC399

This comment was marked as outdated.

Sign in to view
@GiHoon1123

GiHoon1123 commented Sep 30, 2026

Copy link
Copy Markdown
Contributor Author

Sorry about that - didn't follow the one-issue-at-a-time guideline. Closing this for now and focusing on #64627 first, will reopen once that's merged.

All reactions

Sorry, something went wrong.

Uh oh!

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

@GiHoon1123 GiHoon1123 closed this Sep 30, 2026
@MikeMcC399

MikeMcC399 commented Sep 30, 2026

Copy link
Copy Markdown
Member

The problem with multiple PRs for first-time contributors is that every step need to be manually approved by a team member, which creates a high workload and slows down the progression of the PRs.

GiHoon1123 reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

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

@codecov

codecov Bot commented Sep 30, 2026 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.58%. Comparing base (1eb734d) to head (c3cf330).
⚠️ Report is 116 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #66407   +/-   ##
=======================================
  Coverage   90.58%   90.58%           
=======================================
  Files         797      797           
  Lines      278298   278304    +6     
  Branches    53523    53517    -6     
=======================================
+ Hits       252095   252104    +9     
+ Misses      16570    16558   -12     
- Partials     9633     9642    +9     
Files with missing lines Coverage Δ
lib/internal/quic/quic.js 100.00% <100.00%> (ø)

... and 31 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.

@martenrichter

martenrichter commented Oct 19, 2026

Copy link
Copy Markdown
Contributor

@jasnell @pimterry
I think this PR does the trick. I have thought, if there is another way, than always allocating the reader in this case, but I do not think there is.

All reactions

Sorry, something went wrong.

Uh oh!

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

@GiHoon1123

GiHoon1123 commented Oct 19, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for taking a look. I closed this after learning about the first-time contributor guideline to focus on one PR at a time. Would it be okay to reopen it now?

All reactions

Sorry, something went wrong.

Uh oh!

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

@martenrichter

martenrichter commented Oct 19, 2026

Copy link
Copy Markdown
Contributor

Let's see what the others say, I think they can reopen.

All reactions

Sorry, something went wrong.

Uh oh!

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

@martenrichter

martenrichter commented Oct 24, 2026

Copy link
Copy Markdown
Contributor

I think you should reopen.
From me, you get a:

LGTM

as I just cherry picked it to my webtransport branch.

All reactions

Sorry, something went wrong.

Uh oh!

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

@GiHoon1123 GiHoon1123 reopened this Oct 24, 2026
@GiHoon1123

GiHoon1123 commented Oct 24, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for the review! I've reopened the PR.

All reactions

Sorry, something went wrong.

Uh oh!

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

@MikeMcC399

This comment was marked as resolved.

Sign in to view
GiHoon1123 added 2 commits October 24, 2026 16:47
@GiHoon1123
quic: retain readers for readable streams
f057aab
Create readers when readable QuicStream instances are constructed so
data received before the first async iterator pull survives native
stream cleanup. Add a regression test for a peer-initiated
unidirectional stream that sends data and FIN before the reader is
pulled.

Assisted-by: Codex
Signed-off-by: GiHoon1123 <[email protected]>
@GiHoon1123
test: cover QUIC reads after local teardown
c3cf330
Wait for the full payload before destroying a session or stream and
check that buffered data remains readable. Cover explicit errors after
multiple reader batches under both truncated-read policies, and clarify
the destroy documentation.

Assisted-by: Codex
Signed-off-by: GiHoon1123 <[email protected]>
@GiHoon1123
GiHoon1123 force-pushed the fix/quic-unidirectional-reader branch from 2526c29 to c3cf330 Compare October 24, 2026 08:31
@GiHoon1123

GiHoon1123 commented Oct 24, 2026

Copy link
Copy Markdown
Contributor Author

Rebased on main and fixed the commit message line lengths. Thanks!

MikeMcC399 reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

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

pimterry
pimterry approved these changes Oct 30, 2026
View reviewed changes

@pimterry pimterry left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for reopening! Agree this is a good improvement, I'll get this moving.

Sorry, something went wrong.

Uh oh!

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

All reactions
@pimterry pimterry added the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Oct 30, 2026
@github-actions github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Oct 30, 2026
@nodejs-github-bot

nodejs-github-bot commented Oct 30, 2026

Copy link
Copy Markdown
Collaborator

CI: https://ci.nodejs.org/job/node-test-pull-request/78753/

All reactions

Sorry, something went wrong.

Uh oh!

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

bjohansebas
bjohansebas approved these changes Oct 31, 2026
View reviewed changes
@pimterry pimterry added commit-queue PRs queued for automated landing through the Commit Queue. commit-queue-squash PRs the Commit Queue should land as one squashed commit. labels Nov 2, 2026
@nodejs-github-bot
nodejs-github-bot merged commit 1389475 into nodejs:main Nov 2, 2026
71 checks passed

Uh oh!

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

@nodejs-github-bot

nodejs-github-bot commented Nov 2, 2026

Copy link
Copy Markdown
Collaborator

Landed in 1389475

All reactions

Sorry, something went wrong.

Uh oh!

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

@nodejs-github-bot nodejs-github-bot removed the commit-queue PRs queued for automated landing through the Commit Queue. label Nov 2, 2026
aduh95 pushed a commit that referenced this pull request Nov 11, 2026
@GiHoon1123 @aduh95
quic: retain readers for readable streams
ab9d401
Create readers when readable QuicStream instances are constructed so
data received before the first async iterator pull survives native
stream cleanup. Add a regression test for a peer-initiated
unidirectional stream that sends data and FIN before the reader is
pulled.

Assisted-by: Codex
Signed-off-by: GiHoon1123 <[email protected]>
PR-URL: #66407
Fixes: #66347
Reviewed-By: Tim Perry <[email protected]>
@github-actions github-actions Bot mentioned this pull request Nov 11, 2026
2026-11-12, Version 27.0.0-alpha.0.1.0 (Alpha) #67415
Merged
aduh95 pushed a commit that referenced this pull request Nov 12, 2026
@GiHoon1123 @aduh95
quic: retain readers for readable streams
47de18c
Create readers when readable QuicStream instances are constructed so
data received before the first async iterator pull survives native
stream cleanup. Add a regression test for a peer-initiated
unidirectional stream that sends data and FIN before the reader is
pulled.

Assisted-by: Codex
Signed-off-by: GiHoon1123 <[email protected]>
PR-URL: #66407
Fixes: #66347
Reviewed-By: Tim Perry <[email protected]>
@github-actions github-actions Bot mentioned this pull request Nov 20, 2026
2026-11-30, Version 26.14.0 'Lithium' (LTS) #67664
Open
gabylb pushed a commit to gabylb/node that referenced this pull request Nov 27, 2026
@GiHoon1123 @gabylb
quic: retain readers for readable streams
9dec3b9
Create readers when readable QuicStream instances are constructed so
data received before the first async iterator pull survives native
stream cleanup. Add a regression test for a peer-initiated
unidirectional stream that sends data and FIN before the reader is
pulled.

Assisted-by: Codex
Signed-off-by: GiHoon1123 <[email protected]>
PR-URL: nodejs#66407
Fixes: nodejs#66347
Reviewed-By: Tim Perry <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@pimterry pimterry pimterry approved these changes
+1 more reviewer
@bjohansebas bjohansebas bjohansebas approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

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

Assignees

No one assigned

Labels

commit-queue-squash PRs the Commit Queue should land as one squashed commit. needs-ci PRs that need a full CI run. quic Issues and PRs related to the QUIC transport implementation.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

quic: reader is lazily allocated in QuicStream, an incoming unidi stream with fin will loose its data

Uh oh!

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

6 participants

@GiHoon1123 @nodejs-github-bot @MikeMcC399 @martenrichter @pimterry @bjohansebas
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.