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

Error Spawning due to out of control child process generation #3

Closed
okbreathe opened this issue Nov 2, 2010 · 10 comments
Closed

Error Spawning due to out of control child process generation #3

okbreathe opened this issue Nov 2, 2010 · 10 comments

Comments

@okbreathe
Copy link

I'm getting the following error running an Express application with Fugue:

pipe(): Too many open files
child_process:212
  var fds = this.fds = this._internal.spawn(path, args, cwd, envPairs, customF
                                      ^
Error: Error spawning
    at ChildProcess.spawn (child_process:212:39)
    at child_process:9:15
    at /home/XXXX/.npm/.npm/fugue/0.0.35/package/lib/fugue.js:313:48
    at ChildProcess.<anonymous> (/home/XXXX/.npm/.npm/fugue/0.0.35/package/lib/fugue.js:320:13)
    at ChildProcess.emit (events:27:15)
    at ChildProcess.onexit (child_process:168:12)
    at node.js:772:9

I think it happens very quickly as every time I've checked on the application its only spawned two workers (as per my config) - so I've never observed it ballooning to 200+ instances.

@pgte
Copy link
Owner

pgte commented Nov 2, 2010

Hi.

Can you please provide node.js version, OS and fugue.start arguments?

Thanks.

@okbreathe
Copy link
Author

Sorry - I was a bit tired when writing that.

node - v0.2.4
OS - Ubuntu 10.4 (2.6.32-22-generic-pae #36-Ubuntu)
Fugue - fugue.start(app, config.port, null, 2, {daemonize: true, log_file: __dirname + "/log/fugue.log"});

@pgte
Copy link
Owner

pgte commented Nov 3, 2010

Thanks for your feedback.

When daemonizing all weird shit starts happening: (see the comments on http://slashed.posterous.com/writing-daemons-in-javascript-with-nodejs-0 ) and I'm getting impredictable behaviour on several applications.

This has not been an issue for me because I use upstart. (See instructions for node.js + upstart here: http://howtonode.org/deploying-node-upstart-monit ).

Since on several OSs the node.js event loop gets borked when forking, I will be removing support from node.js for daemonizing.
Daemonizing will have to be done externally to node.js, but it's quite easy.

Also I recently did some tests and corrections on the new 0.0.36 version, so I recommend you upgrade your fugue version.

If you do, remove daemonizing and the problem persists, please reopen this ticket.

Thanks.

@okbreathe
Copy link
Author

Hi - thanks for the info. I tried running fugue without the daemonize option and still encountered the same error. This is on fugue v.0.36

fugue.start(app, config.port, null, 4, { log_file: __dirname + "/log/fugue.log"});

@pgte
Copy link
Owner

pgte commented Nov 8, 2010

does the problem happen on app start or on restart (SIGUSR2)?

@okbreathe
Copy link
Author

This is on app start.

@arpunk
Copy link

arpunk commented Nov 8, 2010

Im hitting the same error:

pipe(): Too many open files

child_process:212
  var fds = this.fds = this._internal.spawn(path, args, cwd, envPairs, customF
                                      ^
Error: Error spawning
  at ChildProcess.spawn (child_process:212:39)
  at child_process:9:15
  at /export/services/node/lib/node/.npm/fugue/0.0.36/package/lib/fugue.js:320:48
  at ChildProcess.<anonymous> (/export/services/node/lib/node/.npm/fugue/0.0.36/package/lib/fugue.js:327:13)
  at ChildProcess.emit (events:27:15)
  at ChildProcess.onexit (child_process:168:12)
  at node.js:772:9

On OS X / Solaris 10 / OpenIndiana, under node 0.2.4 / fugue 0.0.36.

My startup code is:

fugue.start(app, 4001, null, 2, {verbose : true, log_file : __dirname + "/log/production.log", master_pid_path : __dirname + '/tmp/pids/master.pid'});

@pgte
Copy link
Owner

pgte commented Nov 9, 2010

Thanks for the reports.
This should now be fixed on version 0.0.37.

@arpunk
Copy link

arpunk commented Nov 9, 2010

Thanks! Awesome work

@pgte
Copy link
Owner

pgte commented Nov 9, 2010

You can post here if the issue doesn't seam solved.
Thanks.

This issue was closed.
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

2 participants