Skip to content

stream: use callback to properly propagate error#29179

Closed
ronag wants to merge 1 commit intonodejs:masterfrom
nxtedition:stream-use-callback
Closed

stream: use callback to properly propagate error#29179
ronag wants to merge 1 commit intonodejs:masterfrom
nxtedition:stream-use-callback

Conversation

@ronag
Copy link
Member

@ronag ronag commented Aug 17, 2019

The stream will be destroyed upstream through the proper error flow.

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

@ronag ronag force-pushed the stream-use-callback branch from 0068306 to d9fc519 Compare August 17, 2019 11:17
@ronag ronag mentioned this pull request Aug 17, 2019
5 tasks
@ronag ronag force-pushed the stream-use-callback branch from d9fc519 to 7018652 Compare August 17, 2019 14:55
@Trott
Copy link
Member

Trott commented Aug 19, 2019

@nodejs/streams

@nodejs-github-bot
Copy link
Collaborator

@mcollina
Copy link
Member

Can you add a unit test for this?

Trott
Trott previously requested changes Aug 19, 2019
Copy link
Member

@Trott Trott left a comment

Choose a reason for hiding this comment

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

This appears to break parallel/test-tls-hello-parser-failure on macOS, SmartOS, and possibly others.

@Trott
Copy link
Member

Trott commented Aug 19, 2019

Here's the test failing on FreeBSD. It also failed on macOS and SmartOS. Might be failing elsewhere too, as CI is still running....

AssertionError [ERR_ASSERTION]: Expected values to be strictly equal:

false !== true

    at Socket.<anonymous> (/usr/home/iojs/build/workspace/node-test-commit-freebsd/nodes/freebsd11-x64/test/parallel/test-tls-hello-parser-failure.js:64:12)
    at Socket.<anonymous> (/usr/home/iojs/build/workspace/node-test-commit-freebsd/nodes/freebsd11-x64/test/common/index.js:371:15)
    at Socket.emit (events.js:209:13)
    at TCP.<anonymous> (net.js:588:12) {
  generatedMessage: true,
  code: 'ERR_ASSERTION',
  actual: false,
  expected: true,
  operator: 'strictEqual'
}

@ronag
Copy link
Member Author

ronag commented Aug 19, 2019

@mcollina: This is a bit over my head in terms of unit tests... I think the observed behaviour will be the same. It's just more "correct" in terms of flow.

@ronag
Copy link
Member Author

ronag commented Aug 20, 2019

@Trott: tests pass now, this needed a little extra fiddling to follow the "proper" stream logic.

In particular we need the socket to be automatically destroyed on error. This also means that the tests can't expect the socket to continue to function once an error has been caused. I had to split one of those test into two separate files.

This probably needs a semver-major...

@ronag ronag force-pushed the stream-use-callback branch 7 times, most recently from 20fac88 to bef7095 Compare August 20, 2019 23:38
@Trott Trott dismissed their stale review August 21, 2019 03:16

test fixed

@nodejs-github-bot
Copy link
Collaborator

@mcollina mcollina added net Issues and PRs related to the net subsystem. 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. labels Aug 21, 2019
@nodejs-github-bot
Copy link
Collaborator

@ronag ronag force-pushed the stream-use-callback branch 3 times, most recently from c8e66f6 to ef9e30f Compare August 21, 2019 22:08
@ronag
Copy link
Member Author

ronag commented Jan 20, 2020

rebased

@ronag ronag force-pushed the stream-use-callback branch from 7a9f01e to 6c9b39b Compare January 20, 2020 08:56
@ronag ronag added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Jan 24, 2020
@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@ronag
Copy link
Member Author

ronag commented Jan 26, 2020

@Trott: Can I get a second opinion on the CI failures on Windows. They seem legit don't they?

@ronag ronag removed the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Jan 26, 2020
@ronag
Copy link
Member Author

ronag commented Jan 28, 2020

Anyone on Windows that might be able to help out debugging the Windows timeouts?

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@Trott
Copy link
Member

Trott commented Feb 5, 2020

@Trott: Can I get a second opinion on the CI failures on Windows. They seem legit don't they?

They do seem legit. After we get the security release out and the CI comes out of embargo, we can try a full rebuild to make sure.

@nodejs-github-bot
Copy link
Collaborator

@ronag
Copy link
Member Author

ronag commented Feb 17, 2020

This needs help with sorting out Windows failures.

@ronag
Copy link
Member Author

ronag commented Feb 17, 2020

This is blocked by #31806 in order to sort out Windows failures

@ronag ronag added the blocked PRs that are blocked by other issues or PRs. label Feb 17, 2020
@ronag ronag force-pushed the stream-use-callback branch from 6c9b39b to a89f557 Compare February 18, 2020 23:40
@nodejs-github-bot

This comment has been minimized.

@ronag ronag force-pushed the stream-use-callback branch from a89f557 to 945c44b Compare February 18, 2020 23:48
@nodejs-github-bot
Copy link
Collaborator

The stream will be destroyed upstream through the proper error
flow.
@ronag ronag force-pushed the stream-use-callback branch from 945c44b to 6b86519 Compare April 3, 2020 06:42
@nodejs-github-bot
Copy link
Collaborator

@ronag
Copy link
Member Author

ronag commented Apr 3, 2020

I think this might finally be landable, @mcollina @jasnell @BridgeAR PTAL

@nodejs-github-bot
Copy link
Collaborator

nodejs-github-bot commented Apr 3, 2020

Copy link
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

@ronag
Copy link
Member Author

ronag commented Apr 3, 2020

Landed in 8f86986

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

Labels

http2 Issues or PRs related to the http2 subsystem. net Issues and PRs related to the net subsystem. 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.

8 participants