You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This PR adds support for copyFile, which can also return EMFILE
errors. I'm currently experiencing this via a third-party build tool that
copies many copies in parallel using Promise.all.
This PR also augments the write-then-read test to additionally copy
the written files and ensure that they exist and have the expected
content.
To add a bit more context: the issue is arising while using Yarn v2's PnP functionality, which also patches fs. As I understand it, Yarn does this in order to transparently support its zipped-up (i.e., non-node_modules) storage of dependencies, while allowing arbitrary packages to read the zipped-up files using normal fs calls. Since those Yarn-internal implementations of copyFile (and other functions) use other fs methods directly (bypassing graceful-fs), they can run into EMFILE errors. See @yarnpkg/fslib for details.
Wrapping the "outer" copyFile call in graceful-fs would provide an opportunity to handle the EMFILE errors and retry.
The reason will be displayed to describe this comment to others. Learn more.
🔌
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds support for
copyFile, which can also return EMFILEerrors. I'm currently experiencing this via a third-party build tool that
copies many copies in parallel using
Promise.all.This PR also augments the
write-then-readtest to additionally copythe written files and ensure that they exist and have the expected
content.
Resolves #122.