[v24.x backport] node:stream/iter and QUIC backports - #64675
Open
aduh95 wants to merge 118 commits into
Open
Conversation
Collaborator
|
Review requested:
|
aduh95
marked this pull request as draft
July 22, 2026 11:55
aduh95
force-pushed
the
stream-iter-and-quic-backports
branch
from
July 22, 2026 11:57
935ead8 to
1a1c988
Compare
aduh95
marked this pull request as ready for review
July 22, 2026 11:57
aduh95
marked this pull request as draft
July 22, 2026 11:58
aduh95
force-pushed
the
stream-iter-and-quic-backports
branch
from
July 22, 2026 11:58
1a1c988 to
975ed7b
Compare
aduh95
marked this pull request as ready for review
July 22, 2026 11:59
aduh95
marked this pull request as draft
July 22, 2026 11:59
aduh95
force-pushed
the
stream-iter-and-quic-backports
branch
from
July 22, 2026 12:00
975ed7b to
2b26bbe
Compare
aduh95
marked this pull request as ready for review
July 22, 2026 12:00
aduh95
force-pushed
the
stream-iter-and-quic-backports
branch
4 times, most recently
from
July 22, 2026 13:32
b28dcf7 to
3c553ff
Compare
aduh95
marked this pull request as draft
July 22, 2026 13:33
aduh95
marked this pull request as ready for review
July 22, 2026 13:33
aduh95
force-pushed
the
stream-iter-and-quic-backports
branch
from
July 22, 2026 13:37
3c553ff to
173b666
Compare
aduh95
force-pushed
the
stream-iter-and-quic-backports
branch
3 times, most recently
from
July 22, 2026 15:53
7e7fa1a to
182db6c
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## v24.x-staging #64675 +/- ##
=================================================
+ Coverage 89.92% 90.23% +0.31%
=================================================
Files 686 710 +24
Lines 208389 226450 +18061
Branches 40077 42776 +2699
=================================================
+ Hits 187387 204341 +16954
- Misses 13238 14100 +862
- Partials 7764 8009 +245 🚀 New features to boost your workflow:
|
aduh95
force-pushed
the
stream-iter-and-quic-backports
branch
2 times, most recently
from
July 24, 2026 09:13
c1ef609 to
421ba7e
Compare
Collaborator
aduh95
pushed a commit
that referenced
this pull request
Aug 6, 2026
Experimental implementation of https://stream-iter.jasnell.me/ Signed-off-by: James M Snell <jasnell@gmail.com> Assisted-By: Claude/Opus 4.6 PR-URL: #62066 Backport-PR-URL: #64675 Reviewed-By: Robert Nagy <ronagy@icloud.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
aduh95
pushed a commit
that referenced
this pull request
Aug 6, 2026
Signed-off-by: Renegade334 <contact.9a5d6388@renegade334.me.uk> PR-URL: #63099 Backport-PR-URL: #64675 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
aduh95
pushed a commit
that referenced
this pull request
Aug 6, 2026
Track the number of consumers at the cached minimum cursor in share() so the minimum is only recomputed when the last consumer at that cursor advances or detaches. This avoids scanning every consumer on each trim attempt when multiple consumers advance through a shared buffer. Signed-off-by: Kamat, Trivikram <16024985+trivikr@users.noreply.github.com> Assisted-by: openai:gpt-5.5 PR-URL: #63262 Backport-PR-URL: #64675 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: René <contact.9a5d6388@renegade334.me.uk>
aduh95
pushed a commit
that referenced
this pull request
Aug 6, 2026
Keep the current batch and index across _read() calls so chunks that remain after push() returns false are emitted on later reads. Fixes: #63275 Signed-off-by: Kamat, Trivikram <16024985+trivikr@users.noreply.github.com> Assisted-by: openai:gpt-5.5 PR-URL: #63276 Backport-PR-URL: #64675 Fixes: #63275 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
aduh95
pushed a commit
that referenced
this pull request
Aug 6, 2026
Avoid allocating a new result array when PushQueue drains a single queued slot. Return that slot directly and keep the existing flattening path for multiple queued slots. Signed-off-by: Kamat, Trivikram <16024985+trivikr@users.noreply.github.com> Assisted-by: openai:gpt-5.5 PR-URL: #63274 Backport-PR-URL: #64675 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ethan Arrowood <ethan@arrowood.dev>
aduh95
pushed a commit
that referenced
this pull request
Aug 6, 2026
Validate options before returning a cached fromWritable() adapter so invalid later options still throw. Cache adapters by backpressure policy as well as Writable instance, since the policy changes write behavior. Fixes: #63277 Signed-off-by: Kamat, Trivikram <16024985+trivikr@users.noreply.github.com> Assisted-by: openai:gpt-5.5 PR-URL: #63278 Backport-PR-URL: #64675 Fixes: #63277 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ethan Arrowood <ethan@arrowood.dev>
aduh95
pushed a commit
that referenced
this pull request
Aug 6, 2026
Ensure fromWritable().writev() uncorks the wrapped Writable when converting a later chunk throws. This prevents an internal cork from leaking after ERR_INVALID_ARG_TYPE. Fixes: #63294 Signed-off-by: Kamat, Trivikram <16024985+trivikr@users.noreply.github.com> Assisted-by: openai:gpt-5.5 PR-URL: #63295 Backport-PR-URL: #64675 Fixes: #63294 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ethan Arrowood <ethan@arrowood.dev>
aduh95
pushed a commit
that referenced
this pull request
Aug 6, 2026
Validate BroadcastWriter writev() and writevSync() inputs before converting chunks so non-array values throw ERR_INVALID_ARG_TYPE. Fixes: #63299 Signed-off-by: Kamat, Trivikram <16024985+trivikr@users.noreply.github.com> Assisted-by: openai:gpt-5.5 PR-URL: #63300 Backport-PR-URL: #64675 Fixes: #63299 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Ethan Arrowood <ethan@arrowood.dev>
aduh95
pushed a commit
that referenced
this pull request
Aug 6, 2026
PushWriter in block backpressure mode can return false from writeSync() and writevSync() after accepting data. Treat that false return as backpressure and wait for drain instead of retrying the same chunks asynchronously. Fixes: #63296 Signed-off-by: Kamat, Trivikram <16024985+trivikr@users.noreply.github.com> Assisted-by: openai:gpt-5.5 PR-URL: #63297 Backport-PR-URL: #64675 Fixes: #63296 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ethan Arrowood <ethan@arrowood.dev>
aduh95
pushed a commit
that referenced
this pull request
Aug 6, 2026
Track how many broadcast consumers share the cached minimum cursor, matching the share implementation. This lets buffer trimming avoid calling getMinCursor() until the last minimum-cursor consumer advances or detaches. Add coverage for fan-out trimming behavior. Signed-off-by: Kamat, Trivikram <16024985+trivikr@users.noreply.github.com> Assisted-by: openai:gpt-5.5 PR-URL: #63322 Backport-PR-URL: #64675 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ethan Arrowood <ethan@arrowood.dev> Reviewed-By: Gürgün Dayıoğlu <hey@gurgun.day>
aduh95
pushed a commit
that referenced
this pull request
Aug 6, 2026
Bound sync iterable normalization in from() and fromSync() to FROM_BATCH_SIZE. This avoids unbounded batches for from() sync iterable fallbacks and lets fromSync() coalesce plain Uint8Array values for writev paths. Signed-off-by: Kamat, Trivikram <16024985+trivikr@users.noreply.github.com> Assisted-by: openai:gpt-5.5 PR-URL: #63324 Backport-PR-URL: #64675 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ethan Arrowood <ethan@arrowood.dev>
aduh95
pushed a commit
that referenced
this pull request
Aug 6, 2026
merge() treated any final non-iterable object as an options object. That dropped valid from() inputs such as ArrayBuffer, ArrayBufferView, and streamable protocol objects. Fixes: #63355 Signed-off-by: Kamat, Trivikram <16024985+trivikr@users.noreply.github.com> Assisted-by: openai:gpt-5.5 PR-URL: #63356 Backport-PR-URL: #64675 Fixes: #63355 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: René <contact.9a5d6388@renegade334.me.uk>
aduh95
pushed a commit
that referenced
this pull request
Aug 6, 2026
Avoid normalizing sync iterable sources through from() when pipeTo() has no transforms or signal and the writer can accept sync writes. This keeps writes incremental while preserving async fallback for values that still need it. Signed-off-by: Kamat, Trivikram <16024985+trivikr@users.noreply.github.com> Assisted-by: openai:gpt-5.5 PR-URL: #63318 Backport-PR-URL: #64675 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ethan Arrowood <ethan@arrowood.dev>
aduh95
pushed a commit
that referenced
this pull request
Aug 6, 2026
Only decrement the remaining byte count after a stream/iter broadcast write is accepted. If writeSync() is blocked by strict backpressure, fall back to the async write() path for the same chunk. Signed-off-by: Kamat, Trivikram <16024985+trivikr@users.noreply.github.com> Assisted-by: openai:gpt-5.5 PR-URL: #63314 Backport-PR-URL: #64675 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
aduh95
pushed a commit
that referenced
this pull request
Aug 6, 2026
Pass signal.reason to the multi-consumer cancel paths so signal abort is reported as AbortError instead of clean iterator completion. Also make detached share consumers rethrow a stored source error when they resume after cancellation, preserving the abort reason for pending pulls. Fixes: #63357 Signed-off-by: Kamat, Trivikram <16024985+trivikr@users.noreply.github.com> Assisted-by: openai:gpt-5.5 PR-URL: #63358 Backport-PR-URL: #64675 Fixes: #63357 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
aduh95
pushed a commit
that referenced
this pull request
Aug 6, 2026
PushWriter can return false after accepting a chunk when block backpressure is active. Teach the classic Writable adapter to treat that case as accepted backpressure instead of retrying through the async write path. Fixes: #63359 Signed-off-by: Kamat, Trivikram <16024985+trivikr@users.noreply.github.com> Assisted-by: openai:gpt-5.5 PR-URL: #63360 Backport-PR-URL: #64675 Fixes: #63359 Reviewed-By: James M Snell <jasnell@gmail.com>
aduh95
pushed a commit
that referenced
this pull request
Aug 6, 2026
Ensure consecutive stateless stream/iter transforms each receive a final null flush after upstream flush output has been processed. Fixes: #63467 Signed-off-by: Kamat, Trivikram <16024985+trivikr@users.noreply.github.com> Assisted-by: openai:gpt-5.5 PR-URL: #63468 Backport-PR-URL: #64675 Fixes: #63467 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Backport of:
stream_iter.md#63406stream_iter.md#64649