Conversation
|
Review requested:
|
|
Needs tests. |
8d1c665 to
deabf75
Compare
deabf75 to
3976f6a
Compare
Don't write to a stream which already has a full buffer. Fixes: nodejs#35341
3976f6a to
591616f
Compare
Fixes: #441 Refs: nodejs/node#35348 Refs: nodejs/node#35341
Fixes: #441 Refs: nodejs/node#35348 Refs: nodejs/node#35341
Fixes: #441 Refs: nodejs/node#35348 Refs: nodejs/node#35341
Fixes: #441 Refs: nodejs/node#35348 Refs: nodejs/node#35341
386afdf to
0811886
Compare
|
@nodejs/streams |
| if (dest.writableNeedDrain === true) { | ||
| if (state.flowing) { | ||
| src.pause(); | ||
| } |
There was a problem hiding this comment.
I'm a little unsure how this affects the case where src is already piped to other destinations?
There was a problem hiding this comment.
🤔 what about adding the stream to the state.awaitDrainWriters (refs pipeOnDrain + ondata(chunk)). Though that may require copying https://github.com/nodejs/node/pull/35348/files#diff-0117344ddd481d021ad96b9c8eea78a5R741-R747 from ondata...
There was a problem hiding this comment.
I have no idea how that works or what it is intended for.
There was a problem hiding this comment.
Any chance this can be reverted or done some other way? It seems to cause issues with the source getting stuck in a paused state if you previously fed the output buffer with a lot of data, see eg, electron/asar#210 That module basically just appends a bunch of files to a single binary, but after a random amount of files it gets stuck due to the source being in a paused state.
This could, of course, be easily worked around by adding the writableNeedDrain loop as in the issue above, or adding a resume call to the stream, but I feel like that shouldn't really be necessary.
| // Start the flow if it hasn't been started already. | ||
| if (!state.flowing) { | ||
|
|
||
| if (dest.writableNeedDrain === true) { |
There was a problem hiding this comment.
Nit: why not:
| if (dest.writableNeedDrain === true) { | |
| if (dest.writableNeedDrain) { |
| if (dest.writableNeedDrain === true) { | ||
| if (state.flowing) { | ||
| src.pause(); | ||
| } |
There was a problem hiding this comment.
🤔 what about adding the stream to the state.awaitDrainWriters (refs pipeOnDrain + ondata(chunk)). Though that may require copying https://github.com/nodejs/node/pull/35348/files#diff-0117344ddd481d021ad96b9c8eea78a5R741-R747 from ondata...
Fixes: #441 Refs: nodejs/node#35348 Refs: nodejs/node#35341
|
@ronag is this ready to land? |
|
Landed in dd0f8f1 |
Fixes: #441 Refs: nodejs/node#35348 Refs: nodejs/node#35341
Fixes: #441 Refs: nodejs/node#35348 Refs: nodejs/node#35341
Fixes: #441 Refs: nodejs/node#35348 Refs: nodejs/node#35341
|
Adding don't land labels until #36544 is resolved. |
|
This requires bug fix in #36563 |
Don't write to a stream which already has a full buffer.
Fixes: #35341
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passes