why isn't graceful-fs just in core all the time?

102 views
Skip to first unread message

Andrew Kelley

unread,
May 17, 2014, 2:02:28 AM5/17/14
to nod...@googlegroups.com
I shouldn't have to manually handle EMFILE errors.


The fact that you have to solve this with monkey patching is an indication that it belongs in core.

You could argue, well there it is, just use it. But as a module author, I can't depend on it, because that monkey patching affects every other module the user uses. A responsible module author will not depend on monkey patching.

There's no good way to handle EMFILE errors. I could set a timeout and try again, but that's bogus. Why wait for an arbitrary period of time when I could get a callback exactly when another handle is closed? This is precisely what graceful-fs does... why is it not in core?!

Warren Lindsey

unread,
May 17, 2014, 1:51:20 PM5/17/14
to nod...@googlegroups.com
+1
--
Job board: http://jobs.nodejs.org/
New group rules: https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
---
You received this message because you are subscribed to the Google Groups "nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nodejs+un...@googlegroups.com.
To post to this group, send email to nod...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/nodejs/5b35c61f-230f-4c04-a079-02f45dd3e95d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Matt

unread,
May 18, 2014, 8:12:43 AM5/18/14
to nod...@googlegroups.com

On Sat, May 17, 2014 at 2:02 AM, Andrew Kelley <super...@gmail.com> wrote:
I shouldn't have to manually handle EMFILE errors.

Why not? They are often an indication that you haven't cleaned up some resource, and so point to an actual bug in your code.

nin jin

unread,
May 19, 2014, 1:10:46 AM5/19/14
to nod...@googlegroups.com
If you simple reading files, you can use queue (as "graceful-fs"). But if you needs watching, queue can not be use. You must inctease descriptors limit by "ulimit" command before starting node.

nin jin

unread,
May 19, 2014, 1:14:37 AM5/19/14
to nod...@googlegroups.com
"Indications" must not crash my application and must be inactivable.
Reply all
Reply to author
Forward
0 new messages