Skip to content
This repository was archived by the owner on Feb 26, 2024. It is now read-only.

Set maxBuffer to avoid ENOBUFS error message #3138

Merged
merged 1 commit into from
Jul 1, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ const semver = require("semver");
const LoadingStrategy = require("./LoadingStrategy");
const VersionRange = require("./VersionRange");

// Set a sensible limit for maxBuffer
// See https://github.com/nodejs/node/pull/23027
const maxBuffer = 1024 * 1024 * 10;

class Docker extends LoadingStrategy {
async load() {
const versionString = await this.validateAndGetSolcVersion();
Expand All @@ -16,7 +20,7 @@ class Docker extends LoadingStrategy {

try {
return {
compile: options => String(execSync(command, { input: options })),
compile: options => String(execSync(command, { input: options, maxBuffer })),
version: () => versionString
};
} catch (error) {
Expand Down