stream: pipe should not swallow error#30993
Closed
ronag wants to merge 5 commits intonodejs:masterfrom
Closed
Conversation
Member
Author
lpinca
reviewed
Dec 16, 2019
| dest.removeListener('error', onerror); | ||
| if (EE.listenerCount(dest, 'error') === 0) { | ||
| if (!dest.destroyed) { | ||
| const s = dest._writableState || dest._readableState; |
Member
There was a problem hiding this comment.
Why dest._readableState? The stream must have a _writableState in order to be writable and be a destination no?
Member
Author
There was a problem hiding this comment.
There is a weird test that fails without it. https://github.com/nodejs/node/blob/master/test/parallel/test-stream-auto-destroy.js#L89
lpinca
reviewed
Dec 16, 2019
lpinca
approved these changes
Dec 16, 2019
mcollina
reviewed
Dec 16, 2019
| // `socket.allowHalfOpen === false`, EOF will cause `.destroySoon()` call which | ||
| // ends the writable side of net.Socket. | ||
| w.end(); | ||
| // end() must be called in nextTick or a WRITE_AFTER_END error occurs. |
Member
There was a problem hiding this comment.
Have we got a test that cover this case?
Member
Author
There was a problem hiding this comment.
Yes, I added a test in this PR, test-stream2-finish-pipe-error.js
addaleax
approved these changes
Dec 18, 2019
jasnell
approved these changes
Dec 18, 2019
lpinca
reviewed
Dec 18, 2019
Co-Authored-By: Luigi Pinca <[email protected]>
This comment has been minimized.
This comment has been minimized.
Trott
approved these changes
Dec 18, 2019
Member
Trott
reviewed
Dec 18, 2019
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
BridgeAR
pushed a commit
that referenced
this pull request
Dec 20, 2019
PR-URL: #30993 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Rich Trott <[email protected]>
Member
|
Landed in 20d009d 🎉 |
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.
pipewould not properly forward uncaught errors.Could be considered bug fix but I still think its semver-major.
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passes