{"action":"opened","issue":{"url":"https://api.github.com/repos/nodejs/node/issues/5872","repository_url":"https://api.github.com/repos/nodejs/node","labels_url":"https://api.github.com/repos/nodejs/node/issues/5872/labels{/name}","comments_url":"https://api.github.com/repos/nodejs/node/issues/5872/comments","events_url":"https://api.github.com/repos/nodejs/node/issues/5872/events","html_url":"https://github.com/nodejs/node/issues/5872","id":143029189,"number":5872,"title":"Cluster doesn't terminate if workers are listening to a port","user":{"login":"dodev","id":1612196,"avatar_url":"https://avatars.githubusercontent.com/u/1612196?v=3","gravatar_id":"","url":"https://api.github.com/users/dodev","html_url":"https://github.com/dodev","followers_url":"https://api.github.com/users/dodev/followers","following_url":"https://api.github.com/users/dodev/following{/other_user}","gists_url":"https://api.github.com/users/dodev/gists{/gist_id}","starred_url":"https://api.github.com/users/dodev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dodev/subscriptions","organizations_url":"https://api.github.com/users/dodev/orgs","repos_url":"https://api.github.com/users/dodev/repos","events_url":"https://api.github.com/users/dodev/events{/privacy}","received_events_url":"https://api.github.com/users/dodev/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-03-23T17:35:34Z","updated_at":"2016-03-23T17:35:34Z","closed_at":null,"body":"Hi, everyone!\r\n\r\nI think I found a bug(?) in cluster. It came up when a colleague of mine was debugging an HTTP service on a port. He uses [supervisor](https://www.npmjs.com/package/supervisor) to track changes in local FS and restart his app with those changes and [recluster](https://www.npmjs.com/package/recluster) to launch several app instances on one listen handle. But the changes he made didn't appear in the running application and he had to restart the app manually.\r\nI started inspecting the issue and I was able to roll out the external dependencies and extract a minimal code sample for reproducing the issue.\r\n\r\n* **Steps to reproduce**:\r\n1. Use any node/iojs >= 2.3.0 to run the minimal code example I've extracted called [echo-cluster](https://gist.github.com/dodev/720b76816b6c72d4949c)\r\n2. Open in a **browser** localhost:8080/ping or some other path. You should recieve 200 and in the body the path you requested.\r\n3. Copy the cluster master process PID from the output of echo-cluster. It should be in square brackets next to the text \"Cluster started\". Use the PID to kill the cluster `kill -s SIGINT <MASTER_PID>`\r\n\r\n* **Result**:\r\nA worker still responds on that port and responds like nothing has happened.\r\n\r\n* **Expected behavior**:\r\nThe worker should be terminated together with master.\r\n\r\n* **Version**: v2.3.0+\r\n* **Platform**: Linux debian 4.4.0-1-amd64 #1 SMP Debian 4.4.6-1 (2016-03-17) x86_64 GNU/Linux\r\n* **Subsystem**: cluster\r\n\r\n**Notes**:\r\n- I had an old project on 0.10.x that used the same dev scaffolding and I didn't experience this issue, this made me think it was an regression. So after some switching between versions and running my test code I found that from v2.3.0 forward this behavior is reproducible. v2.2.1 works fine\r\n- I tried reproducing the issue with `curl` but failed. It is probably of the way the browser interprets the keep-alive header. I would be happy if someone explained why curl doesn't work, I wasn't able to find an answer.\r\n- Another strange thing is that the issue can't be reproduced when the HTTP server listens to a socket file and the client reaches the node app through a nginx proxy\r\n\r\nSorry this was a long one, but I that's as brief as I can get."}}