Skip to content
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

stream: emit finish when using writev and cork #13195

Closed
wants to merge 1 commit into from

Conversation

mcollina
Copy link
Member

@mcollina mcollina commented May 24, 2017

In Writable, 'finish' was not emitted when using writev() and
cork() in the event of an Error. This commit makes it consistent with the write() path,
which emits 'finish'.

Fixes: #11121

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • commit message follows commit guidelines
Affected core subsystem(s)

stream

@nodejs-github-bot nodejs-github-bot added the stream Issues and PRs related to the stream subsystem. label May 24, 2017
@mcollina
Copy link
Member Author

cc @nodejs/streams

@mcollina
Copy link
Member Author

cc @cynron

Copy link
Contributor

@Fishrock123 Fishrock123 left a comment

Choose a reason for hiding this comment

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

@mscdex
Copy link
Contributor

mscdex commented May 24, 2017

There's a typo in the commit message. Also it might be worthwhile to note in the test and commit message that it's only missing when an error occurs/is passed.

@mcollina
Copy link
Member Author

@mscdex updated.

@mscdex
Copy link
Contributor

mscdex commented May 24, 2017

It looks like there were linting errors during the last CI run.

Here's CI again though: https://ci.nodejs.org/job/node-test-pull-request/8283/

@cynron
Copy link
Contributor

cynron commented May 25, 2017

👌

@mscdex
Copy link
Contributor

mscdex commented May 25, 2017

@mcollina Looks like there's still linter errors

In Writable, 'finish' was not emitted when using writev() and
cork() in the event of an Error during the write. This commit
makes it consistent with the write() path, which emits 'finish'.

Fixes: nodejs#11121
@mcollina
Copy link
Member Author

@mscdex weird, https://ci.nodejs.org/job/node-test-linter/9327/console is not showing up what the problem is.

I've amended a line ending, something went wrongly on my box.

Fresh CI: https://ci.nodejs.org/job/node-test-pull-request/8303/

@refack
Copy link
Contributor

refack commented May 25, 2017

@mscdex weird, https://ci.nodejs.org/job/node-test-linter/9327/console is not showing up what the problem is.

Ref: nodejs/build#720 (I have it in my TODO list to fix tools/jslint.js)

@mcollina
Copy link
Member Author

Landed as b153420.

@mcollina mcollina closed this May 26, 2017
@mcollina mcollina deleted the finish-writev branch May 26, 2017 11:58
mcollina added a commit that referenced this pull request May 26, 2017
In Writable, 'finish' was not emitted when using writev() and
cork() in the event of an Error during the write. This commit
makes it consistent with the write() path, which emits 'finish'.

Fixes: #11121
PR-URL: #13195
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Calvin Metcalf <calvin.metcalf@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
jasnell pushed a commit that referenced this pull request May 28, 2017
In Writable, 'finish' was not emitted when using writev() and
cork() in the event of an Error during the write. This commit
makes it consistent with the write() path, which emits 'finish'.

Fixes: #11121
PR-URL: #13195
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Calvin Metcalf <calvin.metcalf@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
@jasnell jasnell mentioned this pull request May 28, 2017
@gibfahn gibfahn mentioned this pull request Jun 15, 2017
3 tasks
mcollina added a commit to mcollina/node that referenced this pull request Jun 21, 2017
When _write completes with an Error, 'finish' was emitted before
'error' if the callback was asynchronous. This commit restore the
previous behavior.
The logic is still less then ideal, because we call the write()
callback before emitting error if asynchronous, but after if
synchronous. This commit do not try to change the behavior.
This commit fixes a regression introduced by:
nodejs#13195.

Fixes: nodejs#13812
@MylesBorins
Copy link
Contributor

@nodejs/LTS

We should not land this in v6.x yet

@mscdex
Copy link
Contributor

mscdex commented Jun 21, 2017

@nodejs/lts ^

@gibfahn gibfahn added the baking-for-lts PRs that need to wait before landing in a LTS release. label Jun 21, 2017
@gibfahn
Copy link
Member

gibfahn commented Jun 21, 2017

This should land with #13850 (assuming that lands), but as Myles says should probably wait another release or two.

mcollina added a commit that referenced this pull request Jun 22, 2017
When _write completes with an Error, 'finish' was emitted before
'error' if the callback was asynchronous. This commit restore the
previous behavior.
The logic is still less then ideal, because we call the write()
callback before emitting error if asynchronous, but after if
synchronous. This commit do not try to change the behavior.
This commit fixes a regression introduced by:
#13195.

Fixes: #13812
PR-URL: #13850
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Calvin Metcalf <calvin.metcalf@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
addaleax pushed a commit that referenced this pull request Jun 24, 2017
When _write completes with an Error, 'finish' was emitted before
'error' if the callback was asynchronous. This commit restore the
previous behavior.
The logic is still less then ideal, because we call the write()
callback before emitting error if asynchronous, but after if
synchronous. This commit do not try to change the behavior.
This commit fixes a regression introduced by:
#13195.

Fixes: #13812
PR-URL: #13850
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Calvin Metcalf <calvin.metcalf@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
@MylesBorins MylesBorins removed the baking-for-lts PRs that need to wait before landing in a LTS release. label Aug 17, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stream Issues and PRs related to the stream subsystem.
Projects
None yet
Development

Successfully merging this pull request may close these issues.