-
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
streams: Writable expose needDrain
#35341
Labels
stream
Issues and PRs related to the stream subsystem.
Comments
@nodejs/streams |
I would call it |
Just a list of things that needs to be updated in this context:
|
ronag
added a commit
to nxtedition/node
that referenced
this issue
Sep 25, 2020
Don't write to a stream which already has a full buffer. Fixes: nodejs#35341
ronag
added a commit
to nodejs/undici
that referenced
this issue
Sep 25, 2020
Fixes: #441 Refs: nodejs/node#35348 Refs: nodejs/node#35341
ronag
added a commit
to nodejs/undici
that referenced
this issue
Sep 25, 2020
Fixes: #441 Refs: nodejs/node#35348 Refs: nodejs/node#35341
ronag
added a commit
to nodejs/undici
that referenced
this issue
Sep 25, 2020
Fixes: #441 Refs: nodejs/node#35348 Refs: nodejs/node#35341
ronag
added a commit
to nodejs/undici
that referenced
this issue
Sep 25, 2020
Fixes: #441 Refs: nodejs/node#35348 Refs: nodejs/node#35341
ronag
added a commit
to nodejs/undici
that referenced
this issue
Oct 10, 2020
Fixes: #441 Refs: nodejs/node#35348 Refs: nodejs/node#35341
ronag
added a commit
to nodejs/undici
that referenced
this issue
Oct 10, 2020
Fixes: #441 Refs: nodejs/node#35348 Refs: nodejs/node#35341
ronag
added a commit
to nodejs/undici
that referenced
this issue
Nov 2, 2020
Fixes: #441 Refs: nodejs/node#35348 Refs: nodejs/node#35341
danielleadams
pushed a commit
that referenced
this issue
Nov 10, 2020
Don't write to a stream which already has a full buffer. Fixes: #35341 PR-URL: #35348 Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]>
ronag
added a commit
to nodejs/undici
that referenced
this issue
Nov 12, 2020
Fixes: #441 Refs: nodejs/node#35348 Refs: nodejs/node#35341
ronag
added a commit
to nodejs/undici
that referenced
this issue
Nov 12, 2020
Fixes: #441 Refs: nodejs/node#35348 Refs: nodejs/node#35341
ronag
added a commit
to nodejs/undici
that referenced
this issue
Nov 13, 2020
Fixes: #441 Refs: nodejs/node#35348 Refs: nodejs/node#35341
BethGriggs
pushed a commit
that referenced
this issue
Dec 9, 2020
Don't write to a stream which already has a full buffer. Fixes: #35341 PR-URL: #35348 Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]>
targos
pushed a commit
that referenced
this issue
May 1, 2021
Don't write to a stream which already has a full buffer. Fixes: #35341 PR-URL: #35348 Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I have a case where it would make sense to expose
needDrain
on the public API.This is when writing to a dst with retries:
Consider:
Now consider the case where:
dst
is pausedsrc
fails due to a timeout (e.g. because dst is to slow to read)Since we don't know whether to continue to write to dst until after we call
dst.write()
every retry will write more data that exceeds the HWM and eventually crashes the process in worst case.For correctness IMO the above should look like this:
However, we currently don't have a
needDrain
property in the public API (and especially notOutgoingMessage
where I encountered this problem).The text was updated successfully, but these errors were encountered: