FredrikNoren / ungit

The easiest way to use git. On any platform. Anywhere.
MIT License
10.44k stars 637 forks source link

Error: EMFILE #89

Closed amadanmath closed 11 years ago

amadanmath commented 11 years ago

OS X default for the file descriptor ulimit is 256 (which is really, really low). So I'm running out of file descriptors pretty much if I as much as scroll the screen once.

It mostly happens at git.js, from holding input and output descriptors to child_process. I suppose it would help if you could wrap the git spawning in an async.queue, in order to keep the simultaneous execution down.

amboy00 commented 11 years ago

I may be getting the same error. This is happening in both small and large repos.

child_process.js:927 throw errnoException(process._errno, 'spawn'); ^ Error: spawn EMFILE at errnoException (child_process.js:980:11) at ChildProcess.spawn (child_process.js:927:11) at exports.spawn (child_process.js:715:9) at Object.exports.execFile (child_process.js:607:15) at Object.exports.exec (child_process.js:578:18) at /usr/local/share/npm/lib/node_modules/ungit/source/git.js:12:31 at Object.q.process as _onImmediate at processImmediate as _immediateCallback

FredrikNoren commented 11 years ago

Should be solved with 0.1.6, please re-open if it still occurs.

DaleLJefferson commented 11 years ago

I've just installed 0.1.6 and I seem to be getting the same issue. I have a fairly large git repo.

error: Error: EMFILE, open '/usr/local/lib/node_modules/ungit/public/images/branchIcon.png'

child_process.js:927 throw errnoException(process._errno, 'spawn'); ^ Error: spawn EMFILE at errnoException (child_process.js:980:11) at ChildProcess.spawn (child_process.js:927:11) at exports.spawn (child_process.js:715:9) at Object.exports.execFile (child_process.js:607:15) at Object.exports.exec (child_process.js:578:18) at /usr/local/lib/node_modules/ungit/source/git.js:12:31 at Object.q.process as _onImmediate at processImmediate as _immediateCallback ungit can't start, see logs for more information.

sontl commented 11 years ago

I have the same issue

info: GET /images/shadowArrowRight.png info: GET /images/blueArrowRight.png

child_process.js:927 throw errnoException(process._errno, 'spawn'); ^ Error: spawn EMFILE at errnoException (child_process.js:980:11) at ChildProcess.spawn (child_process.js:927:11) at exports.spawn (child_process.js:715:9) at Object.exports.execFile (child_process.js:607:15) at Object.exports.exec (child_process.js:578:18) at /usr/local/lib/node_modules/ungit/source/git.js:12:31 at Object.q.process as _onImmediate at processImmediate as _immediateCallback info: socket.io started info: Listening on port 8448

Ungit started

info: handshake authorized

ghost commented 11 years ago

I get the same error:

info: GET /api/diff?file=somefile&path=somepath

child_process.js:927
    throw errnoException(process._errno, 'spawn');
          ^
Error: spawn EMFILE
    at errnoException (child_process.js:980:11)
    at ChildProcess.spawn (child_process.js:927:11)
    at exports.spawn (child_process.js:715:9)
    at Object.exports.execFile (child_process.js:607:15)
    at Object.exports.exec (child_process.js:578:18)
    at /usr/local/lib/node_modules/ungit/source/git.js:12:31
    at Object.q.process [as _onImmediate] (/usr/local/lib/node_modules/ungit/node_modules/async/lib/async.js:728:21)
    at processImmediate [as _immediateCallback] (timers.js:330:15)
info: socket.io started
info: Listening on port 8448
## Ungit started ##

It occours (maybe not exclusively and definitely not always) right after I klick on a changed file to view the differences. On my fifth try everything worked like expected.

Not a problem for me anymore, but maybe it helps you fix the bug.

xMythicx commented 11 years ago

It seems Mac OSX limits file descriptors to 256 as stated by amadanmath you can get around this issues by increasing the limit by issuing this command in terminal "ulimit -n 1024" with out the quotes of course. This is of course just a quick fix to the problem and not a solution. If you decide to change OSX limit for testing purposes I would recommend setting them back to 256 once your done testing.