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

EMFILE, too many open files on Mac OS with JSON API #275

Closed
jareguo opened this issue Sep 13, 2016 · 6 comments
Closed

EMFILE, too many open files on Mac OS with JSON API #275

jareguo opened this issue Sep 13, 2016 · 6 comments

Comments

@jareguo
Copy link

jareguo commented Sep 13, 2016

readJson relies on jsonfile module, which just uses the original node fs module. It will cause the EMFILE error on Mac, so it's better to use graceful-fs everywhere to avoid the EMFILE problem.

@jprichardson
Copy link
Owner

@jareguo good point. Would you submit a PR in jsonfile?

@jareguo
Copy link
Author

jareguo commented Sep 13, 2016

Sorry I don't have much time to submit a PR (and test it) lately, I just bypassed all json API in my project.

@richdunajewski
Copy link

Seeing the same on Windows when writing JSON files in a loop (but waiting for the outputJson callback to fire before going through another iteration to prevent stacking up the writes). Nearly 200,000 iterations occurred before the EMFILE exception was eventually thrown.

Perhaps the callback is firing before the file is truly closed, allowing a variable number of handles to be left open when in a loop situation?

@bhousel
Copy link

bhousel commented Sep 17, 2016

I'm getting this error when using walk too..

@RyanZim
Copy link
Collaborator

RyanZim commented Oct 25, 2016

I'm working on fixing walk.

@RyanZim
Copy link
Collaborator

RyanZim commented Oct 25, 2016

Done jprichardson/node-klaw#10.

When that is merged and klaw makes a new release, this can be closed.

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

5 participants