-
Notifications
You must be signed in to change notification settings - Fork 29.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
piping to a stream with highWaterMark: 0
and objectMode: false
is broken since node v20.10.0
#51930
Labels
stream
Issues and PRs related to the stream subsystem.
Comments
After building nodejs locally, I can confirm this change caused the issue: #50014 |
I will investigate this later today |
dy-dx
changed the title
piping to a stream with
piping to a stream with Mar 12, 2024
highWaterMark: 0
and objectMode: false
does not work as expected, since node v20.10.0highWaterMark: 0
and objectMode: false
is broken since node v20.10.0
james58899
added a commit
to james58899/MusicBot
that referenced
this issue
Apr 28, 2024
This was referenced Apr 28, 2024
@IlyasShabi any progress with this? We hit a similar issue with a custom |
Here is a possible fix if someone wants to take a look at this: diff --git a/lib/internal/streams/writable.js b/lib/internal/streams/writable.js
index 0dbf56d7a69..848247c96e5 100644
--- a/lib/internal/streams/writable.js
+++ b/lib/internal/streams/writable.js
@@ -565,7 +565,7 @@ function writeOrBuffer(stream, state, chunk, encoding, callback) {
state[kState] &= ~kSync;
}
- const ret = state.length < state.highWaterMark;
+ const ret = state.length === 0 || state.length < state.highWaterMark;
if (!ret) {
state[kState] |= kNeedDrain; |
In general I would say that a highWaterMark of 0 doesn't make much sense... |
I will take a look at this 👀 |
EliphazBouye
pushed a commit
to EliphazBouye/node
that referenced
this issue
Jun 20, 2024
Co-authored-by: Robert Nagy <ronagy@icloud.com> PR-URL: nodejs#53261 Fixes: nodejs#51930 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
bmeck
pushed a commit
to bmeck/node
that referenced
this issue
Jun 22, 2024
Co-authored-by: Robert Nagy <ronagy@icloud.com> PR-URL: nodejs#53261 Fixes: nodejs#51930 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Version
v21.6.2
Platform
Darwin x86_64
Subsystem
stream
What steps will reproduce the bug?
How often does it reproduce? Is there a required condition?
Always
What is the expected behavior? Why is that the expected behavior?
In node
v20.9.0
and earlier:What do you see instead?
In node
v20.10.0
and later, only the first chunk ever arrives at the destination:Additional information
The issue is present on node
v20.10.0
, but is not present onv20.9.0
. The issue is also present onv21.0.0
.A workaround is to use
highWaterMark: 1
.The text was updated successfully, but these errors were encountered: