Skip to content

Cluster can't trnasfer MSSQL Result :Error: write ENOTSUP #189

Description

@windwaterbo

After my http server got query result from mssql , I wanted to send them to html . I got error as follow.

events.js:85
      throw er; // Unhandled 'error' event
            ^
Error: write ENOTSUP
    at exports._errnoException (util.js:742:11)
    at ChildProcess.target._send (child_process.js:482:28)
    at ChildProcess.target.send (child_process.js:415:12)
    at sendHelper (cluster.js:657:8)
    at send (cluster.js:493:5)
    at cluster.js:469:7
    at SharedHandle.add (cluster.js:99:3)
    at queryServer (cluster.js:461:12)
    at Worker.onmessage (cluster.js:419:7)
    at ChildProcess.<anonymous> (cluster.js:673:8)

my mssql module using mssql , I have a mssql callback to get query result. Whether directly or indirectly(callback) , to get result . It can't transaction.

ps. node version is v0.11.14

if (cluster.isMaster) {
    console.log('CPUs: ' + os.cpuCount());
    for (var i = 0; i < os.cpuCount(); i += 1) {
        cluster.fork();
    }

    cluster.on('exit', function (worker) {

        // Replace the dead worker, we're not sentimental
        console.log('Worker ' + worker.id + ' died :(');
        cluster.fork();

    });

} else {
.....
.....
app.get('/query/', function(req, res, next) {
async.waterfall([

            function(Acallback) {
                query.acr_query('ACR', Acallback);
            },
            function(result, Acallback) {
                console.log(result);
                var temp=result;
                return res.send(temp);
            }
        ], function(err, result) {

        });

});
......
.....
http.createServer(app).listen(port);
 }

node version is v0.11.14

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions