| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
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 |
Sorry, something went wrong.
Sorry, something went wrong.
There was a problem hiding this comment.
Is yes a valid Windows command?
Sorry, something went wrong.
There was a problem hiding this comment.
I had my coworker on windows type yes into the prompt and it is not a command
Sorry, something went wrong.
There was a problem hiding this comment.
Can also confirm it is not.
Sorry, something went wrong.
|
Is there a reason the test needs to be in sequential instead of parallel? |
Sorry, something went wrong.
|
A couple of questions about the test, but mostly LGTM. I would like sign off from a streams person if possible. |
Sorry, something went wrong.
|
I moved the test into parallel, and I changed its use of yes to the cross-platform echo, double-checking that it still fails on master and passes on this branch. |
Sorry, something went wrong.
There was a problem hiding this comment.
Can you please make this const.
Sorry, something went wrong.
Make the spawned process object a const, and add assertions to the event handler that the arguments are as expected
|
I made p a const, and I added validating assertions to the close event handler. |
Sorry, something went wrong.
|
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 |
Sorry, something went wrong.
|
@cjihrig note: currently the CI is private. See #4029 (comment) |
Sorry, something went wrong.
|
How embarrassing. I've indented the requisite two spaces. Forsooth I can't see anything at the CI link. |
Sorry, something went wrong.
|
@davidvgalbraith could you run make jslint? That should do the trick. :) |
Sorry, something went wrong.
|
make jshint is looking green as of davidvgalbraith@127a82e. |
Sorry, something went wrong.
|
@Fishrock123 good catch about the CI being private. @davidvgalbraith the CI looks fine. There were a couple failures unrelated to this change. LGTM |
Sorry, something went wrong.
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 ... would you consider this a bug fix (and thus suitable for LTS) or an add? |
Sorry, something went wrong.
|
I would consider this a bug fix. |
Sorry, something went wrong.
|
Looks like this new test here is failing on CentOS: https://ci.nodejs.org/job/node-test-commit-linux/1387/nodes=centos5-32/tapResults/ test-child-process-flush-stdio.js
# Mismatched <anonymous> function calls. Expected 1, actual 0.
# at Object.<anonymous> (/home/iojs/build/workspace/node-test-commit-linux/nodes/centos5-64/test/parallel/test-child-process-flush-stdio.js:8:22)
# at Module._compile (module.js:399:26)
# at Object.Module._extensions..js (module.js:406:10)
# at Module.load (module.js:345:32)
# at Function.Module._load (module.js:302:12)
# at Function.Module.runMain (module.js:431:10)
# at startup (node.js:138:18)
# at node.js:976:3
|
Sorry, something went wrong.
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>
|
Not going to land this until we are ready to land #4215 into LTS... I think it needs a bit more time |
Sorry, something went wrong.
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>
| Back | FazBrowse Home | New Git URL |
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.