Repository navigation
quic: retain readers for readable streams - #66407
GiHoon1123 wants to merge 2 commits into
Conversation
|
Review requested:
|
|
Welcome to Node.js, and thank you for your first contribution! Before review, please take a moment to read:
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. |
This comment was marked as outdated.
This comment was marked as outdated.
|
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. |
|
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. |
Codecov Report✅ All modified and coverable lines are covered by tests. 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
🚀 New features to boost your workflow:
|
|
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? |
|
Let's see what the others say, I think they can reopen. |
|
I think you should reopen. LGTM as I just cherry picked it to my webtransport branch. |
|
Thanks for the review! I've reopened the PR. |
This comment was marked as resolved.
This comment was marked as resolved.
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]>
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]>
2526c29 to
c3cf330
Compare
|
Rebased on main and fixed the commit message line lengths. Thanks! |
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
truncatedReadspolicies, and documented this behavior.Rebased onto main at 763524d and wrapped the commit message to 72 columns.
Validation on macOS:
python3 tools/test.py --mode=release -j6 -t60 -p tap 'parallel/test-quic*':269 passed, 2 skipped (
ngtcp2_test_clientandngtcp2_test_serverbinaries not built)doc/api/quic.md