-
Notifications
You must be signed in to change notification settings - Fork 74
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
Bundle tools should handle EMFILE gracefully #1593
Comments
Famous last words but I wouldn't expect handling these errors directly from native |
* added Either type for extendable, expressive error handling. * updated read function behavior with demonstration code showing how to gracefully handle EMFILE errors. unsophisticated approach which simply calls read once again with the same location argument it began its execution with.
Note to self: the particular feature of
That would enable complete usage of the finite number of FDs. The basic "limit parallelism" scheme that I first had in mind would require us to guess how many we could use, and our guess would likely either exceed the environment's limit, or leave some number of FDs unused (nominally leaving some parallelism opportunities, and perhaps thus performance, on the table). That said, using EMFILE-retried And, we might still want to limit parallelism of the |
Fixed by #1697. |
Bundling opens a lot of concurrent file descriptors, sometimes more than are available, especially when running the bundler concurrently. We should address this in general, but specifically for the
bundle-source
tool.Tools like
bundle-source
currently construct their file system capabilities from'fs'
module, which does not gracefully handle EMFILE or EAGAIN. Thegraceful-fs
package innpm
takes care of these concerns but does not provide a promise abstraction. We would need to lower thecompartment-mapper
node-powers
module a layer of abstraction and embracefs
callbacks directly to usegraceful-fs
as a drop-in replacement forfs
.Alternately, we should implement graceful handling of these errors ourselves in the compartment mapper. This would implicitly improve other existing applications, since the concern of attenuating an
fs
power is currently deferred to the individual application entrypoints.The author of this issue notes that we could have the best of all worlds had
graceful-fs
been implemented as a powerless adapter and did not importfs
directly.The text was updated successfully, but these errors were encountered: