Skip to content

ERR_CHILD_PROCESS_STDIO_MAXBUFFER when running audit -g -s #7

@oatkiller

Description

@oatkiller

Hi all.
Thanks for maintaining this project. I am getting an error when running the audit command. I think it is caused by https://github.com/snyk/github-codeowners/blob/main/src/lib/file/readGit.ts#L5 which reads the entire git ls-files

Changing that line to:

const { stdout } = await exec('git ls-files', { cwd: dir, maxBuffer: 1024 * 1024 * 1024 });

Fixes the error, although the command is slower. For context, here is the beginning of the output:

--- Counts ---
Total: 62265 files (11911663 lines) 100%
Loved: 57515 files (7899241 lines) 66.32%
Unloved: 4750 files (4012422 lines 33.68%

I think this command could be optimized by listening to events on child processes and processing the data as a stream, perhaps using iterators or event listeners. I would be willing to take a shot at making this change in a PR, but I would like to gauge interest in such a change. Thanks for taking the time to look at my issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions