From fefd78a427fdf0b91e19c1becbf9d59b78939696 Mon Sep 17 00:00:00 2001 From: Sebastian Van Sande Date: Mon, 6 Feb 2017 11:36:19 +0100 Subject: [PATCH] child_process: increase default maxBuffer Increase the default maxBuffer for child_process.exec from 200 * 1024 bytes to 1024 KB so child processes don't get terminated too soon. This is a fix for https://github.com/nodejs/node/issues/9829 --- doc/api/child_process.md | 2 +- lib/child_process.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/api/child_process.md b/doc/api/child_process.md index df0ba49dbd7c60..fd0cedd6bd7e7e 100644 --- a/doc/api/child_process.md +++ b/doc/api/child_process.md @@ -136,7 +136,7 @@ added: v0.1.90 command line parsing should be compatible with `cmd.exe`.) * `timeout` {number} (Default: `0`) * `maxBuffer` {number} Largest amount of data in bytes allowed on stdout or - stderr. (Default: `200*1024`) If exceeded, the child process is terminated. + stderr. (Default: `1024*1024`) If exceeded, the child process is terminated. See caveat at [`maxBuffer` and Unicode][]. * `killSignal` {string|integer} (Default: `'SIGTERM'`) * `uid` {number} Sets the user identity of the process. (See setuid(2).) diff --git a/lib/child_process.js b/lib/child_process.js index c2811109b7bbee..b5943a0706076e 100644 --- a/lib/child_process.js +++ b/lib/child_process.js @@ -146,7 +146,7 @@ exports.execFile = function(file /*, args, options, callback*/) { var options = { encoding: 'utf8', timeout: 0, - maxBuffer: 200 * 1024, + maxBuffer: 1024 * 1024, killSignal: 'SIGTERM', cwd: null, env: null,