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

Compiler chokes on large source trees #3588

Closed
ehberger opened this issue Aug 14, 2014 · 1 comment
Closed

Compiler chokes on large source trees #3588

ehberger opened this issue Aug 14, 2014 · 1 comment

Comments

@ehberger
Copy link

With more than about 250 coffeescript files, a call to the compiler fails.

Repro:
In an empty directory:
Create 250 empty .coffee files
for i in seq 1 250; do touch $i.coffee; done
then try to compile them
coffee -c .

Observed:
I've seen a couple of failures, all seemingly related to running out of file descriptors.
One full run:

eric:coffee eric$ for i in `seq 1 250`; do touch $i.coffee; done
eric:coffee eric$ coffee -c .
(libuv) Failed to create kqueue (24)
(libuv) Failed to create kqueue (24)

events.js:72
        throw er; // Unhandled 'error' event
              ^
Error: write EBADF
  at errnoException (net.js:901:11)
  at WriteStream.Socket._write (net.js:643:26)
  at doWrite (_stream_writable.js:221:10)
  at writeOrBuffer (_stream_writable.js:211:5)
  at WriteStream.Writable.write (_stream_writable.js:180:11)
  at WriteStream.Socket.write (net.js:613:40)
  at printLine (/usr/local/lib/node_modules/coffee-script/lib/coffee-script/command.js:27:27)
  at /usr/local/lib/node_modules/coffee-script/lib/coffee-script/command.js:459:20
  at fs.js:944:21
  at Object.oncomplete (fs.js:107:15)

Expected:
I would expect it to queue up some reasonable number of parallel files instead of opening everything at once, or to recover gracefully from the failure.

I searched for related issues and found several related to watch (e.g. #1537 and #2004 ) which have been closed as non-fixable due to hard OS limitations on number of open files, but for a compilation it seems like there should be no issue with just limiting the number of concurrent operations.

Would a patch for this be welcome?

@jashkenas
Copy link
Owner

A patch for this would be welcome ... but the easy fix is just to up your ulimit. You often have to do that anyways, these days.

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

3 participants