jakejs / jake

JavaScript build tool, similar to Make or Rake. Built to work with Node.js.
http://jakejs.com
Apache License 2.0
1.97k stars 190 forks source link

warning: possible Eventemitter memory leak detected (with testcase) #285

Open msprotz opened 9 years ago

msprotz commented 9 years ago

Hi,

This issue has been mentioned at numerous times (#157, #117, #109). None of these issues had a testcase. Here's one.

Jakefile: at https://gist.github.com/msprotz/9629f4a26ebc45f4973e

Steps to reproduce.

mkdir t
cd t
curl -O https://gist.githubusercontent.com/msprotz/9629f4a26ebc45f4973e/raw/e0bb07ce34e2585ff3041cd0f15c3413220e0153/gistfile1.txt
mv gistfile1.txt Jakefile
echo "foobar" > baz
jake

Basically, my default task depends on [ 'foo0', ..., 'foo19' ]. Each one of the fooᵢ depends on bar. Since I'm doing a parallel build with a large branching factor, each one of the fooᵢ listens for completion on bar, which causes the warning to be emitted.

Please note that while this test-case is fairly un-realistic, we have this issue in a regular project that just happens to have a non-trivial dependency graph.

Thanks,

Jonathan

msprotz commented 9 years ago

(I forgot to mention that applying the fix suggested by node, i.e. calling prereq.setMaxListeners(LARGE_CONSTANT); in task.js:152 fixes the issue.)

mde commented 9 years ago

Thanks!