Skip to content

quic: fix get_reader bug that lost data from open streams on FIN#63946

Open
pimterry wants to merge 1 commit into
nodejs:mainfrom
pimterry:fix-quic-reader-after-fin
Open

quic: fix get_reader bug that lost data from open streams on FIN#63946
pimterry wants to merge 1 commit into
nodejs:mainfrom
pimterry:fix-quic-reader-after-fin

Conversation

@pimterry

Copy link
Copy Markdown
Member

Currently if you receive a stream, but you don't start reading the body immediately, you can lose the stream body entirely even while the stream is still open.

This happens because get_reader returned an empty reader if is_readable() was false, which happens when the stream's data is finished, even though it may be happily received and ready to read. This happens even if the writable side of the stream is open and the stream is otherwise active as normal.

This is reasonably common I think. For an HTTP/3 server where you receive a request and you do anything async before you start reading the body, if the client finishes the body before you start reading it (a small body delivered within the flow control window) you'd just get empty data. Nice easy standalone fix & test.

Signed-off-by: Tim Perry <pimterry@gmail.com>
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/quic

@nodejs-github-bot nodejs-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 Jun 16, 2026
@pimterry pimterry added the request-ci Add this label to start a Jenkins CI on a PR. label Jun 19, 2026
@github-actions github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Jun 19, 2026
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@bjohansebas bjohansebas left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM!

@bjohansebas bjohansebas added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Jun 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author ready PRs 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-ci PRs that need a full CI run. quic Issues and PRs related to the QUIC implementation / HTTP/3.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants