Skip to content
Browse files

This resolves an issue where a random TCP client goes away before a r…

…esponse

is sent from the server. The resulting exception was not handled, and would
cause node.js to crash.

The log file would show this message as a result:
node.js:201
        throw e; // process.nextTick error, or 'error' event on first tick
              ^
Error: write ECONNRESET
    at errnoException (net.js:642:11)
    at Object.afterWrite [as oncomplete] (net.js:480:18)
  • Loading branch information...
1 parent 81db702 commit 324267c527133b97f8902f4479af676bc0d7ce58 Devdas Bhagat committed Jan 2, 2013
Showing with 4 additions and 0 deletions.
  1. +4 −0 stats.js
View
4 stats.js
@@ -193,6 +193,10 @@ config.configFile(process.argv[2], function (config, oldConfig) {
mgmtServer = net.createServer(function(stream) {
stream.setEncoding('ascii');
+ stream.on('error', function(err) {
+ l.log('Caught ' + err +', Moving on')
+ });
+
stream.on('data', function(data) {
var cmdline = data.trim().split(" ");
var cmd = cmdline.shift();

0 comments on commit 324267c

Please sign in to comment.
Something went wrong with that request. Please try again.