| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
|
That test only verify if maxBuffer will allow Infinity but the default is still 200 * 1024. |
Sorry, something went wrong.
|
Doesn't it throw error if buffer size over default ? |
Sorry, something went wrong.
|
I thought that it was cause the size allocated, but actually it is accepting really long buffers and if surpass extremely large values, the buffer gets a small size again, it should be fixed instead of documented imo |
Sorry, something went wrong.
|
Thank you for all review. I created new PR that work default maxBuffer. Please review it. |
Sorry, something went wrong.
There was a problem hiding this comment.
LGTM. See #23027 (comment) for discussion.
@koh110 or whoever lands this: please add this information from the PR description to the commit message body before landing:
Correctly document the default maxBuffer size for execSync, execFileSync, and spawnSync. It is 200 * 1024, not Infinity. Add tests to verify behaviour is as documented.
Sorry, something went wrong.
|
@koh110 Are you sure the documentation changes here are complete? Since execSync and execFileSync call spawnSync, doesn't their documentation need to be changed as well? |
Sorry, something went wrong.
There was a problem hiding this comment.
Can you manually confirm that these tests pass as-is, but fail when the default is changed, as it is in #23027?
Sorry, something went wrong.
|
@sam-github execSync and execFileSync document need to be changed. Thank for your pointing out. I fixed it. This code is passed Node.js v10.15.0. const args = ['-e', "console.log('a'.repeat(200 * 1024))"];
spawnSync(process.execPath, args);It will fail when the default is changed. This test shows it. |
Sorry, something went wrong.
|
cc @nodejs/child_process |
Sorry, something went wrong.
|
@nodejs/documentation Anyone else approve? |
Sorry, something went wrong.
|
@nodejs/documentation Anyone else approve? |
Sorry, something went wrong.
|
/cc @nodejs/documentation |
Sorry, something went wrong.
|
Anyone else approve? |
Sorry, something went wrong.
|
@thefourtheye If you don't have other comments, would you approve? |
Sorry, something went wrong.
Sorry, something went wrong.
Sorry, something went wrong.
|
@sam-github CI failed, but test is not wrong. This reason is timeout on Travis. Would you kick CI? The job exceeded the maximum time limit for jobs, and has been terminated. |
Sorry, something went wrong.
Sorry, something went wrong.
|
Failed on travis, looked like a timeout, test may have ran too long. I restarted. Is there any chance the tests you added to prove that the maxBuffer is "infinite" are excessively time/cpu/memory consuming? |
Sorry, something went wrong.
There was a problem hiding this comment.
I'm building locally, to get a sense for the performance of this. It might use too much data. I might see if the console.logs that write giant strings can be written in a way that runs faster, or uses less memory.
We can't merge tests that make travis ci flaky. There is another set of tests, test/pummel, that some of these could perhaps go into if its not stable in test/parallel. They get run less frequently, but would still serve to check if the default behaviour changed.
Sorry, something went wrong.
test/parallel/test-child-process-exec-maxBuffer.js | 23 ++++++ test/parallel/test-child-process-execfile-maxBuffer.js | 94 ++++++++++++++++++++++++ .../parallel/test-child-process-execfilesync-maxbuf.js | 46 ++++++++++++ test/parallel/test-child-process-execsync-maxbuf.js | 37 ++++++++++ test/parallel/test-child-process-spawnsync-maxbuf.js | 8 ++ Please lower-case the filenames, and use consistent suffixes: change the maxBuffer to maxbuf. |
Sorry, something went wrong.
There was an issue with Travis builds in general timing out that was fixed a few days ago in #27002. |
Sorry, something went wrong.
|
Builds tend to take 24-30 minutes, see https://travis-ci.com/nodejs/node/builds https://travis-ci.com/nodejs/node/builds/106252842 for this PR is up to 50 |
Sorry, something went wrong.
|
Btw, node -p '"a".repeat(50)' might be more concise. |
Sorry, something went wrong.
The Travis build for this PR was timing out compiling V8/Node.js and didn't even start running the tests. This is unlikely to be caused by this PR, which only touches documentation and tests. I've wiped out the cache in Travis for this PR so that it instead it picks up the cache for the master branch and restarted the build. It's in progress but looks to be much faster (compilation has actually succeeded and it's started running tests now). Update: Travis build passed. |
Sorry, something went wrong.
|
@richardlau so you think this is stable enough to merge? I think it needs one more approval, @nodejs/child_process , though since its been open for much more than 7 days, maybe my approval alone is sufficient? |
Sorry, something went wrong.
From the point of view of not destabilizing the build, yes. |
Sorry, something went wrong.
Correctly document the default maxBuffer size for execSync, execFileSync, and spawnSync. It is 200 * 1024, not Infinity. Add tests to verify behaviour is as documented.
Sorry, something went wrong.
|
@koh110 I pushed my suggested changes. I'll merge this when CI is green. Thanks for your patience. |
Sorry, something went wrong.
Sorry, something went wrong.
Correctly document the default maxBuffer size for execSync, execFileSync, and spawnSync. It is 200 * 1024, not Infinity. Add tests to verify behaviour is as documented. PR-URL: #22894 Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Correctly document the default maxBuffer size for execSync, execFileSync, and spawnSync. It is 200 * 1024, not Infinity. Add tests to verify behaviour is as documented. PR-URL: #22894 Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Set the default maxBuffer size to 204,800 bytes for execSync, execFileSync, and spawnSync. APIs that return the child output as a string should have non-infinite defaults for maxBuffer sizes to avoid out-of-memory error conditions. A non-infinite default used to be the documented behaviour for all relevant APIs, but the implemented behaviour for execSync, execFileSync and spawnSync was to have no maxBuffer limits. PR-URL: #23027 Refs: #22894 Reviewed-By: Sam Roberts <vieuxtech@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Correctly document the default maxBuffer size for execSync, execFileSync, and spawnSync. It is 200 * 1024, not Infinity. Add tests to verify behaviour is as documented. PR-URL: #22894 Reviewed-By: Sam Roberts <vieuxtech@gmail.com> Signed-off-by: Beth Griggs <Bethany.Griggs@uk.ibm.com>
Correctly document the default maxBuffer size for execSync, execFileSync, and spawnSync. It is 200 * 1024, not Infinity. Add tests to verify behaviour is as documented. PR-URL: #22894 Reviewed-By: Sam Roberts <vieuxtech@gmail.com> Signed-off-by: Beth Griggs <Bethany.Griggs@uk.ibm.com>
| Back | FazBrowse Home | New Git URL |
Fixed document default maxBuffer size at spawnSync. I changed 200 * 1024 to Infinity.
And add test to spawnSync, exec and execFile according to the document.
I think that maxBuffer size should be 200 * 1024 at spawnSync, but comment said that maxBuffer size allowed Infinity on test/parallel/test-child-process-spawnsync-maxbuf.js. And it is working now.
Therefore, I just change document and add test.
Checklist