Skip to content

Socket: Not running issue when disconnecting cluster #18

@AlexMeah

Description

@AlexMeah

First off great module, unfortunately we are seeing a high number of the error below when cycling boxes during deployment.

Error: Not running
    at Socket._healthCheck (dgram.js:420:11)
    at Socket.send (dgram.js:272:8)
    at Lynx.send (/usr/local/moonstick/node_modules/lynx/lib/lynx.js:470:10)
    at Lynx.count (/usr/local/moonstick/node_modules/lynx/lib/lynx.js:310:8)
    at Lynx.increment (/usr/local/moonstick/node_modules/lynx/lib/lynx.js:228:8)
    at module.exports (/usr/local/moonstick/lib/middleware/requestStats.js:8:13)

I have put together a simple example to reproduce the error

var Lynx = require('./lib/lynx');
var cluster = require('cluster');

var metrics = new Lynx('localhost', 2056);

if (cluster.isMaster) {
    for (var i = 0; i < 1; i++) {
        cluster.fork();
    }

    cluster.on('exit', function (worker, code, signal) {
        console.log('worker ' + worker.process.pid + ' died');
    });

    cluster.on('online', function (worker, code, signal) {
        console.log('worker ' + worker.process.pid + ' online');
        cluster.disconnect();
    });
} else {
    metrics.increment('node_test.int', 1);
}

We could add a custom error handler and filter these but I believe it is a issue with Lynx as googling the stack shows similar issues in other module which use dgram.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions