Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ERR_CHILD_PROCESS_STDIO_MAXBUFFER when running audit -g -s #7

Open
oatkiller opened this issue May 10, 2023 · 0 comments
Open

ERR_CHILD_PROCESS_STDIO_MAXBUFFER when running audit -g -s #7

oatkiller opened this issue May 10, 2023 · 0 comments

Comments

@oatkiller
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant