Uh oh!
There was an error while loading. Please reload this page.
child_process.flushStdio: resume _consuming streams - #4071
child_process.flushStdio: resume _consuming streams#4071davidvgalbraith wants to merge 4 commits into
Conversation
When a client calls read() with a nonzero argument on a Socket, that Socket sets this._consuming to true. It never sets this._consuming back to false. child_process.flushStdio currently doesn't flush any streams where _consuming is truthy. But that means that it never flushes any stream that has ever been read from. This prevents a child process from ever closing if one of its streams has been read from, causing issue nodejs#4049. child_process.flushStdio should flush streams even if their _consuming is set to true. Then it will close even after a read.
Fishrock123
commented
Nov 30, 2015
cc @nodejs/streams |
Fishrock123
commented
Nov 30, 2015
There was a problem hiding this comment.
Is yes a valid Windows command?
There was a problem hiding this comment.
I had my coworker on windows type yes into the prompt and it is not a command
There was a problem hiding this comment.
Can also confirm it is not.
cjihrig
commented
Nov 30, 2015
Is there a reason the test needs to be in |
cjihrig
commented
Nov 30, 2015
A couple of questions about the test, but mostly LGTM. I would like sign off from a streams person if possible. |
davidvgalbraith
commented
Nov 30, 2015
I moved the test into |
There was a problem hiding this comment.
Can you please make this const.
Make the spawned process object a const, and add assertions to the event handler that the arguments are as expected
davidvgalbraith
commented
Nov 30, 2015
I made |
cjihrig
commented
Nov 30, 2015
Started a CI run: https://ci.nodejs.org/job/node-test-pull-request/883/ The linter doesn't like your indentation - https://ci.nodejs.org/job/node-test-linter/434/console |
Fishrock123
commented
Nov 30, 2015
@cjihrig note: currently the CI is private. See #4029 (comment) |
davidvgalbraith
commented
Nov 30, 2015
How embarrassing. I've indented the requisite two spaces. Forsooth I can't see anything at the CI link. |
Fishrock123
commented
Nov 30, 2015
@davidvgalbraith could you run |
davidvgalbraith
commented
Nov 30, 2015
|
cjihrig
commented
Nov 30, 2015
@Fishrock123 good catch about the CI being private. @davidvgalbraith the CI looks fine. There were a couple failures unrelated to this change. LGTM |
When a client calls read() with a nonzero argument on a Socket, that Socket sets this._consuming to true. It never sets this._consuming back to false. ChildProcess.flushStdio() currently doesn't flush any streams where _consuming is truthy. But, that means that it never flushes any stream that has ever been read from. This prevents a child process from ever closing if one of its streams has been read from, causing issue #4049. This commit allows consuming streams to be flushed, and the child process to emit a close event. Fixes: #4049 PR-URL: #4071 Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
cjihrig
commented
Dec 1, 2015
Thanks! Landed in 34b535f |
jasnell
commented
Dec 2, 2015
@cjihrig ... would you consider this a bug fix (and thus suitable for LTS) or an add? |
cjihrig
commented
Dec 2, 2015
I would consider this a bug fix. |
silverwind
commented
Dec 3, 2015
Looks like this new test here is failing on CentOS: https://ci.nodejs.org/job/node-test-commit-linux/1387/nodes=centos5-32/tapResults/ |
cjihrig
commented
Dec 3, 2015
Yes. See #4125 |
When a client calls read() with a nonzero argument on a Socket, that Socket sets this._consuming to true. It never sets this._consuming back to false. ChildProcess.flushStdio() currently doesn't flush any streams where _consuming is truthy. But, that means that it never flushes any stream that has ever been read from. This prevents a child process from ever closing if one of its streams has been read from, causing issue #4049. This commit allows consuming streams to be flushed, and the child process to emit a close event. Fixes: #4049 PR-URL: #4071 Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
MylesBorins
commented
Dec 29, 2015
Not going to land this until we are ready to land #4215 into LTS... I think it needs a bit more time |
When a client calls read() with a nonzero argument on a Socket, that Socket sets this._consuming to true. It never sets this._consuming back to false. ChildProcess.flushStdio() currently doesn't flush any streams where _consuming is truthy. But, that means that it never flushes any stream that has ever been read from. This prevents a child process from ever closing if one of its streams has been read from, causing issue #4049. This commit allows consuming streams to be flushed, and the child process to emit a close event. Fixes: #4049 PR-URL: #4071 Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
When a client calls read() with a nonzero argument on a Socket, that Socket sets this._consuming to true. It never sets this._consuming back to false. ChildProcess.flushStdio() currently doesn't flush any streams where _consuming is truthy. But, that means that it never flushes any stream that has ever been read from. This prevents a child process from ever closing if one of its streams has been read from, causing issue #4049. This commit allows consuming streams to be flushed, and the child process to emit a close event. Fixes: #4049 PR-URL: #4071 Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
When a client calls read() with a nonzero argument on a Socket, that Socket sets this._consuming to true. It never sets this._consuming back to false. ChildProcess.flushStdio() currently doesn't flush any streams where _consuming is truthy. But, that means that it never flushes any stream that has ever been read from. This prevents a child process from ever closing if one of its streams has been read from, causing issue nodejs#4049. This commit allows consuming streams to be flushed, and the child process to emit a close event. Fixes: nodejs#4049 PR-URL: nodejs#4071 Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Hey! I'm new here. Tried to follow all the guidelines. Thanks for your attention!
When a client calls read() with a nonzero argument
on a Socket, that Socket sets this._consuming to true.
It never sets this._consuming back to false.
child_process.flushStdio currently doesn't flush
any streams where _consuming is truthy. But that means
that it never flushes any stream that has ever been read from.
This prevents a child process from ever closing if one of
its streams has been read from, causing issue #4049.
child_process.flushStdio should flush streams even if their
_consuming is set to true. Then it will close even after a read.