Thanks to visit codestin.com
Credit goes to github.com

Skip to content

maxListeners warning when running multiple processes in parallel #765

@ehmicky

Description

@ehmicky

When running more than 10 execa() calls in parallel, a maxListeners warning is printed.

For this bug to happen, the option must be an array, and one of the value must be 'inherit' (or the equivalent 0, 1, 2, process.stdin, process.stdout or process.stderr). That's because each process pipes from/to the same global object, which creates more than 10 event listeners on that event emitter.

await Promise.all(Array.from({length: 11}, () => execa('...', {
  stdin: ['pipe', 'inherit'], 
  stdout: ['pipe', 'inherit'], 
  stderr: ['pipe', 'inherit'],
}));

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions