Uh oh!
There was an error while loading. Please reload this page.
quic: remove unused fin flag from blob reader wakeup - #65315
Conversation
nodejs-github-bot
commented
Aug 15, 2026
Review requested:
|
jasnell
commented
Aug 16, 2026
@trivenay ... this will need a rebase |
Rebased on main — thanks for the heads-up! |
9a01ab0 to
9cbb5e4CompareCodecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@## main #65315 +/- ##
==========================================
- Coverage 91.71% 90.06% -1.66%
==========================================
Files 402 754 +352 Lines 181151 255731 +74580 Branches 27805 48323 +20518 ==========================================
+ Hits 166147 230317 +64170 - Misses 14664 16546 +1882 - Partials 340 8868 +8528
🚀 New features to boost your workflow:
|
The |
jasnell
commented
Aug 16, 2026
Just a note, this will have a few conflicts with #65309 but nothing major. |
trivenay
commented
Aug 16, 2026
Sure — happy to rebase once #65309 lands. |
trivenay
commented
Aug 28, 2026
9cbb5e4 to
ebbaec7Compare
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
nodejs-github-bot
commented
Aug 29, 2026
jasnell
commented
Aug 29, 2026
The PR likely needs to be rebased in order for CI to pass. |
The fin argument threaded from Blob::Reader::NotifyPull to the JS blob reader iterator was dead: the only consumer, `if (fin) continue;`, was the last statement in the loop and behaved identically to falling through. End-of-stream is always discovered by the subsequent pull returning EOS, never via the wakeup label. Remove the flag from the JS iterator, NotifyPull's signature/argv, and the EndReadable call site. The `!fin` coalescing bypass collapses safely because a parked reader always has pull_pending_ == false, so the first wakeup after parking always fires. Refs: nodejs#64767 Signed-off-by: Naman Trivedi <trivenay@amazon.com>
ebbaec7 to
2ebf33dComparenodejs-github-bot
commented
Aug 29, 2026
Uh oh!
There was an error while loading. Please reload this page.
nodejs-github-bot
commented
Aug 30, 2026
Landed in f63bffd |
The fin argument threaded from Blob::Reader::NotifyPull to the JS blob reader iterator was dead: the only consumer, `if (fin) continue;`, was the last statement in the loop and behaved identically to falling through. End-of-stream is always discovered by the subsequent pull returning EOS, never via the wakeup label. Remove the flag from the JS iterator, NotifyPull's signature/argv, and the EndReadable call site. The `!fin` coalescing bypass collapses safely because a parked reader always has pull_pending_ == false, so the first wakeup after parking always fires. Refs: #64767 Signed-off-by: Naman Trivedi <trivenay@amazon.com> PR-URL: #65315 Reviewed-By: Tim Perry <pimterry@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Fixes the dead code identified in #64767.
The blob reader used by QUIC inbound streams has two separate channels. The pull channel is where the iterator asks for data and gets a real answer: a chunk, "blocked, nothing available yet", or "end of stream". The wakeup channel exists only to wake a parked iterator after a blocked pull so it pulls again — it carries no data and answers no question.
The wakeup additionally carried a boolean label saying whether it was triggered by end-of-stream. That label is dead information: whatever it says, the woken iterator does the same single thing — loop back and pull. If the stream has ended, that next pull returns end-of-stream by itself, because the receive queue was already capped when the FIN was processed. The pull channel is the source of truth for "am I done?"; the label was a second announcement of something the very next pull confirms anyway, and the branch consuming it (
if (fin) continue;as the final statement of the loop) behaves identically to not existing.This removes the label end to end while keeping the wakeup itself: the JS iterator no longer reads a value from the wakeup promise, the C++ notifier no longer constructs or passes the boolean, and the end-of-stream path still fires a (now unlabeled) wakeup. All actual FIN processing — recording the final size, capping the receive queue, the stream state flags — is untouched.
One consequence deserves reviewer attention. The notifier coalesces wakeups: once it has woken the iterator, further wakeups are suppressed until the iterator actually pulls. Previously, end-of-stream wakeups bypassed that suppression "just in case". With the label gone the bypass goes too, so end-of-stream wakeups now coalesce like any other. This cannot stall the iterator: the iterator only parks after a pull returned "blocked", every pull resets the suppression flag on entry, and only synchronous JavaScript runs between that pull and the park — so a parked iterator always has suppression clear, and the first wakeup after parking always gets through. The bypass only ever fired while the iterator was already awake and about to pull, where an extra wakeup changes nothing.
Changes:
lib/internal/blob.js— stop reading a value from the wakeup; delete the dead branch and its comment.src/node_blob.cc,src/node_blob.h—NotifyPull()loses its boolean parameter and JS-facing argument.src/quic/streams.cc— the end-of-stream call site drops the argument.No behavior change; no new test. Existing
test/parallel/test-quic-*andtest/parallel/test-blob*pass on the compiled binary.