child_process.flushStdio: resume _consuming streams#4071
child_process.flushStdio: resume _consuming streams#4071davidvgalbraith wants to merge 4 commits intonodejs:masterfrom
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.
|
cc @nodejs/streams |
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.
|
Is there a reason the test needs to be in |
|
A couple of questions about the test, but mostly LGTM. I would like sign off from a streams person if possible. |
|
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
|
I made |
|
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 |
|
@cjihrig note: currently the CI is private. See #4029 (comment) |
|
How embarrassing. I've indented the requisite two spaces. Forsooth I can't see anything at the CI link. |
|
@davidvgalbraith could you run |
|
|
|
@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 <[email protected]>
|
Thanks! Landed in 34b535f |
|
@cjihrig ... would you consider this a bug fix (and thus suitable for LTS) or an add? |
|
I would consider this a bug fix. |
|
Looks like this new test here is failing on CentOS: https://ci.nodejs.org/job/node-test-commit-linux/1387/nodes=centos5-32/tapResults/ |
|
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 <[email protected]>
|
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
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.