I have been using the node v0.4.X branch in production along with
daemon.node (https://github.com/indexzero/daemon.node) to run node
apps from init scripts for a few months now. I recently tried to
upgrade to v0.6.10 and noticed that my application would run but
didn't appear to be doing anything. After digging in, I narrowed it
down to http.get() specifically. After get() was called none of the
callbacks are ever called. I reduced it down to a pretty straight
forward example:
var daemon = require('daemon');
var fs = require('fs');
var http = require('http');
fs.open('test.log', 'w+', function (err, fd) {
daemon.start(fd);
var options = {
host: 'www.google.com',
port: 80,
path: '/index.html'
};
console.log('Making request');
http.get(options, function(res) {
console.log('Got response: ' + res.statusCode);
}).on('error', function(e) {
console.log('Got error: ' + e.message);
});
});
When this code is run, "Making request" is written to test.log, but
neither the callback or the error event are ever called. The
application will continue to run forever though and has to be killed
manually. While it's possible that it is daemon.node's fault, I feel
like is unlikely since all it does is fork the process and redirect
the standard streams. And 'Making request' is written to the log,
which is after the fork.
I am testing on CentOS 5.3
Has anyone else experienced problems after forking a node
application?
--
Job Board: http://jobs.nodejs.org/
Posting guidelines:
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en