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

fix: limit concurrent open files during 'npm cache verify' #7631

Merged
merged 2 commits into from
Jul 9, 2024

Conversation

oikumene
Copy link
Contributor

@oikumene oikumene commented Jul 8, 2024

This change solves #4783

During 'npm cache verify', currently all the cache files are open at the same time, which will bring EMFILE error in an environment that limit max open files.
This change limits the concurrent open files in garbageCollect() with p-map module to avoid this problem.

References

Fixes #4783

@oikumene oikumene requested a review from a team as a code owner July 8, 2024 07:24
@oikumene oikumene mentioned this pull request Jul 8, 2024
2 tasks
@wraithgar wraithgar changed the title Limit concurrent open files during 'npm cache verify' to avoid EMFILE. fix: limit concurrent open files during 'npm cache verify' Jul 9, 2024
@wraithgar wraithgar merged commit 3101a40 into npm:latest Jul 9, 2024
22 of 23 checks passed
@github-actions github-actions bot mentioned this pull request Jul 9, 2024
wraithgar pushed a commit to npm/cacache that referenced this pull request Jul 11, 2024
<!-- What / Why -->
<!-- Describe the request in detail. What it does and why it's being
changed. -->
During 'npm cache verify', currently all the cache files are open at the
same time, which will bring EMFILE error in an environment that limit
max open files.
This change limits the concurrent open files in garbageCollect() with
p-map module to avoid this problem.
I first sent this pull request to npm/cli and it was merged, but
realized that the original was in this repository.

## References
npm/cli#7631
npm/cli#4783
@hashtagchris hashtagchris mentioned this pull request Aug 20, 2024
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.

[BUG] npm cache verify EMFILE
2 participants