stream: fix pipeToSync byte accounting#63564
Draft
trivikr wants to merge 1 commit into
Draft
Conversation
Collaborator
|
Review requested:
|
Stop pipeToSync() from counting chunks when writeSync() or writevSync() returns false without accepting the data. Preserve writers that use false as an accepted backpressure signal. Fixes: nodejs#63562 Signed-off-by: Kamat, Trivikram <16024985+trivikr@users.noreply.github.com> Assisted-by: openai:gpt-5.5
0b933ff to
8b50431
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #63564 +/- ##
========================================
Coverage 90.33% 90.33%
========================================
Files 730 730
Lines 234362 234487 +125
Branches 43906 43932 +26
========================================
+ Hits 211713 211835 +122
- Misses 14371 14389 +18
+ Partials 8278 8263 -15
🚀 New features to boost your workflow:
|
Member
Author
|
Converted to draft as behavior should be confirmed in specification Details #63562 (comment) |
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.
Fixes: #63562
pipeToSync()ignored explicitfalsereturns fromwriteSync()andwritevSync(), so it could report bytes for chunks that were not accepted bythe writer.
This updates
pipeToSync()to stop counting rejected sync writes while stillpreserving writers that intentionally return
falseafter accepting data as abackpressure signal.
Assisted-by: openai:gpt-5.5