When calling worker.kill(signal) and passing a signal, the signal does not get sent to worker process as per documentation.
http://nodejs.org/api/cluster.html#cluster_worker_kill_signal_sigterm
Example:
var cluster = require('cluster');
if (cluster.isMaster) {
cluster.fork();
cluster.on('exit', function(worker, code, signal) {
console.log('Worker exited:', worker.process.pid);
});
setTimeout(function () {
for (var id in cluster.workers) {
var worker = cluster.workers[id];
worker.kill('SIGUSR2');
}
}, 2000);
} else {
process.on('SIGUSR2', function() {
//WHY DOES THIS NOT GET CALLED? http://nodejs.org/api/cluster.html#cluster_worker_kill_signal_sigterm
console.log('SIGUSR2 called', process.pid);
});
console.log('Worker listening for SIGUSR2', process.pid);
}
When calling worker.kill(signal) and passing a signal, the signal does not get sent to worker process as per documentation.
http://nodejs.org/api/cluster.html#cluster_worker_kill_signal_sigterm
Example: