Skip to content

stream: pipe should not swallow error#30993

Closed
ronag wants to merge 5 commits intonodejs:masterfrom
nxtedition:fix-pipe-unhandled
Closed

stream: pipe should not swallow error#30993
ronag wants to merge 5 commits intonodejs:masterfrom
nxtedition:fix-pipe-unhandled

Conversation

@ronag
Copy link
Copy Markdown
Member

@ronag ronag commented Dec 16, 2019

pipe would not properly forward uncaught errors.

Could be considered bug fix but I still think its semver-major.

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines

@nodejs-github-bot nodejs-github-bot added the stream Issues and PRs related to the stream subsystem. label Dec 16, 2019
@ronag
Copy link
Copy Markdown
Member Author

ronag commented Dec 16, 2019

@mcollina @lpinca

@mscdex mscdex added the semver-major PRs that contain breaking changes and should be released in the next major version. label Dec 16, 2019
Comment thread lib/_stream_readable.js
dest.removeListener('error', onerror);
if (EE.listenerCount(dest, 'error') === 0) {
if (!dest.destroyed) {
const s = dest._writableState || dest._readableState;
Copy link
Copy Markdown
Member

@lpinca lpinca Dec 16, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why dest._readableState? The stream must have a _writableState in order to be writable and be a destination no?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment thread test/parallel/test-stream2-finish-pipe.js
@nodejs-github-bot
Copy link
Copy Markdown
Collaborator

// `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.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have we got a test that cover this case?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I added a test in this PR, test-stream2-finish-pipe-error.js

Copy link
Copy Markdown
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

Comment thread test/parallel/test-stream2-finish-pipe-error.js Outdated
@nodejs-github-bot

This comment has been minimized.

@Trott
Copy link
Copy Markdown
Member

Trott commented Dec 18, 2019

@Trott Trott added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Dec 18, 2019
Comment thread test/parallel/test-stream2-finish-pipe.js Outdated
@nodejs-github-bot

This comment has been minimized.

@nodejs-github-bot

This comment has been minimized.

@nodejs-github-bot
Copy link
Copy Markdown
Collaborator

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]>
@BridgeAR
Copy link
Copy Markdown
Member

Landed in 20d009d 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author ready PRs that have at least one approval, no pending requests for changes, and a CI started. semver-major PRs that contain breaking changes and should be released in the next major version. stream Issues and PRs related to the stream subsystem.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants