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 #4

Closed
blowsie opened this issue Oct 10, 2014 · 1 comment
Closed

EMFILE, too many open files #4

blowsie opened this issue Oct 10, 2014 · 1 comment

Comments

@blowsie
Copy link

blowsie commented Oct 10, 2014

Im using asnyc (https://www.npmjs.org/package/async) - eachSeries to iterate through my files one at a time, and also logging open and close just for sanity. However after a 1021 files, I get the following error.
Error: EMFILE, too many open files

I'm guessing something is not being closed properly by the plugin?

async.eachSeries(self.items, function (value, callback) {
    console.log('open')
    fc(value.originalFile, value.targetFile, function (isEqual) {
        if (!isEqual) {
            self.invalidate(report);
        }
        console.log('close');
        callback();
    });

}, function (err) {
    if (err) {
        console.error(err)
    }
    console.log('done')
});

open
close
open
close
open

Error: EMFILE, too many open files *****************************
at Object.fs.openSync (fs.js:438:18)
    at Object.exports.file (c:\Users\Sam\Desktop\node-dir-compare\node-dir-compare\node-dir-compare\node_modules\filecompare\lib\index.js:5:17)
    at module.exports (c:\Users\Sam\Desktop\node-dir-compare\node-dir-compare\node-dir-compare\node_modules\filecompare\index.js:4:18)
    at c:\Users\Sam\Desktop\node-dir-compare\node-dir-compare\node-dir-compare\pro-compare.js:76:17
    at iterate (c:\Users\Sam\Desktop\node-dir-compare\node-dir-compare\node-dir-compare\node_modules\async\lib\async.js:149:13)
    at c:\Users\Sam\Desktop\node-dir-compare\node-dir-compare\node-dir-compare\node_modules\async\lib\async.js:160:25
    at null._onTimeout (c:\Users\Sam\Desktop\node-dir-compare\node-dir-compare\node-dir-compare\pro-compare.js:82:25)
    at Timer.listOnTimeout [as ontimeout] (timers.js:112:15)
@rook2pawn
Copy link
Owner

https://github.com/rook2pawn/node-filecompare/blob/master/lib/index.js#L35-L45

@blowsie
Sorry for the late reply. Files are now closed just before the callback.

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 a pull request may close this issue.

2 participants