Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 34.3k
stdio: make stdout and stderr emit 'close' on destroy#26691
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
Uh oh!
There was an error while loading. Please reload this page.
Conversation
mcollina commented Mar 15, 2019 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
nodejs-github-bot commented Mar 15, 2019
mcollina commented Mar 15, 2019
| if(!this._writableState.emitClose){ | ||
| process.nextTick(()=>{ | ||
| this.emit('close'); | ||
| }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How come the nextTick is required in this case?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The previous cb() could emitting an error via nextTick. Close should be emitted afterwards.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you ok/can this PR land, or would you like to see some different resolution for this?
mcollina commented Mar 16, 2019
| // SyncWriteStream does not use the stream | ||
| // destroy mechanism for some legacy reason. | ||
| // TODO(mcollina): remove when | ||
| // https://github.com/nodejs/node/pull/26690 lands. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What exactly are you intending to remove? The dummyDestroy() function? It’s intentional that stdio streams, SyncWriteStream or not, cannot “really” be closed (so that file descriptors 0, 1, 2 don’t accidentally get closed).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The if check underneath. See the linked PR. Basically we can have a callback or not for this function.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#26690 was merged so this needs to go now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can! However that was a semver-major commit and this is not. I would prefer to issue a follow-up PR that will not be backported. This can (and should) be backported.
mcollina commented Mar 17, 2019
@nodejs/build can you take a look at https://ci.nodejs.org/job/node-test-commit-linux/26139/nodes=ubuntu1604-64/console? there seems a problem with that machine, if failed a couple of times. |
mcollina commented Mar 17, 2019
rvagg commented Mar 17, 2019
I've updated, cleaned and rebooted that ubuntu machine, will see if that helps |
Trott commented Mar 17, 2019 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
A root-owned directory was left around after some troubleshooting (generating a core file for another issue), and Resume Build CI: https://ci.nodejs.org/job/node-test-pull-request/21615/ ✅ |
mcollina commented Mar 20, 2019
I will look to land this next Monday if there are no further objections. I'd also open a new PR to remove that if check at the same time. |
mcollina commented Mar 25, 2019
Landed in bdea725 |
Fix: #26550 PR-URL: #26691 Fixes: https://github.com/falseFixes: #26550 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Anna Henningsen <[email protected]>
nodejs#26691 introduced an if to protect against SyncWriteStream not using the default .destroy() mechanism. This change removes that as SyncWriteStream now use standard .destroy(). See: nodejs#26691
lpinca commented Mar 25, 2019
Commit landed with messed up metadata, I guess it's too late to fix it. |
mcollina commented Mar 25, 2019
Ouch, I didn't notice. I relied too blindly on git node land. |
joyeecheung commented Mar 25, 2019
We should probably add some stricter checks in https://github.com/nodejs/core-validate-commit for these cases |
Fix: nodejs#26550 PR-URL: nodejs#26691 Fixes: https://github.com/falseFixes: nodejs#26550 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Anna Henningsen <[email protected]>
Fix: #26550 PR-URL: #26691 Fixes: https://github.com/falseFixes: #26550 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Anna Henningsen <[email protected]>
#26691 introduced an if to protect against SyncWriteStream not using the default .destroy() mechanism. This change removes that as SyncWriteStream now use standard .destroy(). See: #26691 PR-URL: #26902 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Anna Henningsen <[email protected]>
richardlau commented Mar 31, 2019
|
#26691 introduced an if to protect against SyncWriteStream not using the default .destroy() mechanism. This change removes that as SyncWriteStream now use standard .destroy(). See: #26691 PR-URL: #26902 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Anna Henningsen <[email protected]>
BethGriggs commented Jul 9, 2019
@mcollina should this still land on v10.x? |
mcollina commented Jul 9, 2019
Yes please |
Fix: #26550 PR-URL: #26691 Fixes: https://github.com/falseFixes: #26550 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Anna Henningsen <[email protected]>
Fix: #26550 PR-URL: #26691 Fixes: https://github.com/falseFixes: #26550 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Anna Henningsen <[email protected]>
The problem in #26550 was caused by
net.Sockethaving setemitClose: falsebecause it was emitted its own event in_destroy(), andstdio.jswas overriding_destroywithout emitting'close'.Fix: #26550
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passes