Skip to content
This repository was archived by the owner on Apr 22, 2023. It is now read-only.
This repository was archived by the owner on Apr 22, 2023. It is now read-only.

node clusters cannot be killed #2060

@christophsturm

Description

@christophsturm

with the demo code from the cluster docs:

var cluster = require('cluster');
var http = require('http');
var numCPUs = require('os').cpus().length;

if (cluster.isMaster) {
  // Fork workers.
  for (var i = 0; i < numCPUs; i++) {
    cluster.fork();
  }

  cluster.on('death', function(worker) {
    console.log('worker ' + worker.pid + ' died');
  });
} else {
  // Worker processes have a http server.
  http.Server(function(req, res) {
    res.writeHead(200);
    res.end("hello world\n");
  }).listen(8000);
}
chi:petrol christoph$ node minicluster.js &
[1] 14330
chi:petrol christoph$ Worker 14332 online
Worker 14333 online
Worker 14331 online
Worker 14334 online

chi:petrol christoph$ kill 14330
$ ps | grep node
14331 ttys000    0:00.10 /Users/christoph/.nvm/v0.6.0/bin/node /Users/christoph/Projects/collmedia/petrol/minicluster.js
14332 ttys000    0:00.10 /Users/christoph/.nvm/v0.6.0/bin/node /Users/christoph/Projects/collmedia/petrol/minicluster.js
14333 ttys000    0:00.10 /Users/christoph/.nvm/v0.6.0/bin/node /Users/christoph/Projects/collmedia/petrol/minicluster.js
14334 ttys000    0:00.10 /Users/christoph/.nvm/v0.6.0/bin/node /Users/christoph/Projects/collmedia/petrol/minicluster.js
$ curl http://127.0.0.1:8000/
hello world
$ node -v
v0.6.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions