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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ENOBUFS error when there's huge amounts of output #23

Merged
merged 1 commit into from May 15, 2021
Merged

Fix ENOBUFS error when there's huge amounts of output #23

merged 1 commit into from May 15, 2021

Conversation

Stephen2
Copy link
Contributor

@Stephen2 Stephen2 commented May 8, 2021

Using pipe appears to create the possibility of ENOBUFS errors when there's huge amounts of advisories/text.

Whereas using the method in this PR to pipe the outputs doesn't cause that error.

BEFORE:

npx improved-yarn-audit --ignore-dev-deps --min-severity high

... normal output ...

/usr/share/yarn/lib/cli.js:92892  throw err;  ^Error: write ENOBUFS    at afterWriteDispatched (internal/stream_base_commons.js:154:25)    at writevGeneric (internal/stream_base_commons.js:137:3)    at Socket._writeGeneric (net.js:784:11)    at Socket._writev (net.js:793:8)    at doWrite (_stream_writable.js:401:12)    at clearBuffer (_stream_writable.js:519:5)    at onwrite (_stream_writable.js:454:7)    at WriteWrap.onWriteComplete [as oncomplete] (internal/stream_base_commons.js:101:10) {  errno: 'ENOBUFS',  code: 'ENOBUFS',  syscall: 'write'}

The heart of the error really feels like: yarnpkg/yarn#7404 yarn audit --json produces large amounts of data

Running yarn audit --json produces 922MiB of data using Merit's monorepo 馃く

Nevertheless, changing stream handling as per this PR appears to fix the error, no matter how silly the JSON size gets

Copy link
Owner

@djfdyuruiry djfdyuruiry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this - will release a patch with this fix

@djfdyuruiry djfdyuruiry merged commit 30beed2 into djfdyuruiry:master May 15, 2021
@Stephen2 Stephen2 deleted the sp-fix-enobufs branch May 17, 2021 21:42
@Stephen2 Stephen2 restored the sp-fix-enobufs branch May 17, 2021 21:58
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

Successfully merging this pull request may close these issues.

None yet

2 participants