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.

Cluster worker.kill(signal) does not pass the signal parameter #6042

Description

@BorePlusPlus

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);
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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