From 4ed3d5452c11c6dfc5bb537a59af4f55ec36495e Mon Sep 17 00:00:00 2001 From: Olivier Boucher Date: Fri, 16 Mar 2018 11:20:20 -0400 Subject: [PATCH 1/2] Added a 1MB maxBuffer since the default 200kb is too small on larger proto codebases --- packages/grpc-tools/bin/protoc_plugin.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/grpc-tools/bin/protoc_plugin.js b/packages/grpc-tools/bin/protoc_plugin.js index fbdafff7..19fcc740 100755 --- a/packages/grpc-tools/bin/protoc_plugin.js +++ b/packages/grpc-tools/bin/protoc_plugin.js @@ -32,7 +32,7 @@ var exe_ext = process.platform === 'win32' ? '.exe' : ''; var plugin = path.resolve(__dirname, 'grpc_node_plugin' + exe_ext); -var child_process = execFile(plugin, process.argv.slice(2), {encoding: 'buffer'}, function(error, stdout, stderr) { +var child_process = execFile(plugin, process.argv.slice(2), {encoding: 'buffer', maxBuffer: 1024 * 1000}, function(error, stdout, stderr) { if (error) { throw error; } From fe752be0c1f02be11ae2feb53b4e730fee9d9d42 Mon Sep 17 00:00:00 2001 From: Olivier Boucher Date: Mon, 26 Mar 2018 09:40:20 -0400 Subject: [PATCH 2/2] Update maxBuffer limit to 100Mib --- packages/grpc-tools/bin/protoc_plugin.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/grpc-tools/bin/protoc_plugin.js b/packages/grpc-tools/bin/protoc_plugin.js index 19fcc740..22aa03d8 100755 --- a/packages/grpc-tools/bin/protoc_plugin.js +++ b/packages/grpc-tools/bin/protoc_plugin.js @@ -32,7 +32,7 @@ var exe_ext = process.platform === 'win32' ? '.exe' : ''; var plugin = path.resolve(__dirname, 'grpc_node_plugin' + exe_ext); -var child_process = execFile(plugin, process.argv.slice(2), {encoding: 'buffer', maxBuffer: 1024 * 1000}, function(error, stdout, stderr) { +var child_process = execFile(plugin, process.argv.slice(2), {encoding: 'buffer', maxBuffer: 1024 * 1024 * 100}, function(error, stdout, stderr) { if (error) { throw error; }