{"action":"opened","issue":{"url":"https://api.github.com/repos/nodejs/node/issues/4852","labels_url":"https://api.github.com/repos/nodejs/node/issues/4852/labels{/name}","comments_url":"https://api.github.com/repos/nodejs/node/issues/4852/comments","events_url":"https://api.github.com/repos/nodejs/node/issues/4852/events","html_url":"https://github.com/nodejs/node/issues/4852","id":128453962,"number":4852,"title":"Cluster: Worker#kill() does not send SIGTERM signal","user":{"login":"mntnoe","id":705340,"avatar_url":"https://avatars.githubusercontent.com/u/705340?v=3","gravatar_id":"","url":"https://api.github.com/users/mntnoe","html_url":"https://github.com/mntnoe","followers_url":"https://api.github.com/users/mntnoe/followers","following_url":"https://api.github.com/users/mntnoe/following{/other_user}","gists_url":"https://api.github.com/users/mntnoe/gists{/gist_id}","starred_url":"https://api.github.com/users/mntnoe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mntnoe/subscriptions","organizations_url":"https://api.github.com/users/mntnoe/orgs","repos_url":"https://api.github.com/users/mntnoe/repos","events_url":"https://api.github.com/users/mntnoe/events{/privacy}","received_events_url":"https://api.github.com/users/mntnoe/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-01-25T04:01:07Z","updated_at":"2016-01-25T04:01:07Z","closed_at":null,"body":"I am having problems running cleanup for code that might or might not be run in a worker. The [documentation for Worker#kill()](https://nodejs.org/api/cluster.html#cluster_worker_kill_signal_sigterm) says that a signal is sent, but the following snippet does not trigger the handler:\r\n\r\n    var cluster = require('cluster');\r\n    if (cluster.isMaster) {\r\n      var worker = cluster.fork();\r\n      setTimeout(function() {\r\n        worker.kill(); // 'handler' is not displayed\r\n        // process.kill(worker.process.pid); // 'handler' is displayed\r\n      }, 1000);\r\n    }\r\n    else if (cluster.isWorker) {\r\n      process.on('SIGTERM', function() {\r\n        console.log('handler');\r\n        process.exit();\r\n      })\r\n    }\r\n\r\nAm I missing something?"}}