{"action":"created","issue":{"url":"https://api.github.com/repos/nodejs/node/issues/4349","labels_url":"https://api.github.com/repos/nodejs/node/issues/4349/labels{/name}","comments_url":"https://api.github.com/repos/nodejs/node/issues/4349/comments","events_url":"https://api.github.com/repos/nodejs/node/issues/4349/events","html_url":"https://github.com/nodejs/node/pull/4349","id":123026756,"number":4349,"title":"cluster: fix race condition setting suicide prop","user":{"login":"santigimeno","id":1084056,"avatar_url":"https://avatars.githubusercontent.com/u/1084056?v=3","gravatar_id":"","url":"https://api.github.com/users/santigimeno","html_url":"https://github.com/santigimeno","followers_url":"https://api.github.com/users/santigimeno/followers","following_url":"https://api.github.com/users/santigimeno/following{/other_user}","gists_url":"https://api.github.com/users/santigimeno/gists{/gist_id}","starred_url":"https://api.github.com/users/santigimeno/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/santigimeno/subscriptions","organizations_url":"https://api.github.com/users/santigimeno/orgs","repos_url":"https://api.github.com/users/santigimeno/repos","events_url":"https://api.github.com/users/santigimeno/events{/privacy}","received_events_url":"https://api.github.com/users/santigimeno/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/nodejs/node/labels/cluster","name":"cluster","color":"f7c6c7"},{"url":"https://api.github.com/repos/nodejs/node/labels/lts-watch-v4.x","name":"lts-watch-v4.x","color":"eb6420"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":17,"created_at":"2015-12-18T21:11:57Z","updated_at":"2015-12-26T03:50:17Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/nodejs/node/pulls/4349","html_url":"https://github.com/nodejs/node/pull/4349","diff_url":"https://github.com/nodejs/node/pull/4349.diff","patch_url":"https://github.com/nodejs/node/pull/4349.patch"},"body":"There is no guarantee that the `suicide` property of a worker in the master\r\nprocess is going to be set when the `disconnect` and `exit` events are emitted.\r\nTo fix it, wait for the ACK of the suicide message from the master before\r\ndisconnecting the worker.\r\nModify `test-regress-GH-3238` so it checks both the `kill` and `disconnect`\r\ncases. Also take into account that the `disconnect` event may be received after\r\nthe `exit` event.\r\n\r\nI discovered this because I was sometimes getting this error:\r\n```\r\nassert.js:89\r\n  throw new assert.AssertionError({\r\n  ^\r\nAssertionError: false === true\r\n    at Worker.<anonymous> (/Users/sgimeno/node/node/test/parallel/test-regress-GH-3238.js:17:12)\r\n    at Worker.<anonymous> (/Users/sgimeno/node/node/test/common.js:401:15)\r\n    at emitTwo (events.js:88:13)\r\n    at Worker.emit (events.js:173:7)\r\n    at ChildProcess.<anonymous> (cluster.js:361:14)\r\n    at ChildProcess.g (events.js:264:16)\r\n    at emitTwo (events.js:88:13)\r\n    at ChildProcess.emit (events.js:173:7)\r\n    at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)\r\n```\r\nI don't know if it's the proper fix though"},"comment":{"url":"https://api.github.com/repos/nodejs/node/issues/comments/167275220","html_url":"https://github.com/nodejs/node/pull/4349#issuecomment-167275220","issue_url":"https://api.github.com/repos/nodejs/node/issues/4349","id":167275220,"user":{"login":"Trott","id":718899,"avatar_url":"https://avatars.githubusercontent.com/u/718899?v=3","gravatar_id":"","url":"https://api.github.com/users/Trott","html_url":"https://github.com/Trott","followers_url":"https://api.github.com/users/Trott/followers","following_url":"https://api.github.com/users/Trott/following{/other_user}","gists_url":"https://api.github.com/users/Trott/gists{/gist_id}","starred_url":"https://api.github.com/users/Trott/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Trott/subscriptions","organizations_url":"https://api.github.com/users/Trott/orgs","repos_url":"https://api.github.com/users/Trott/repos","events_url":"https://api.github.com/users/Trott/events{/privacy}","received_events_url":"https://api.github.com/users/Trott/received_events","type":"User","site_admin":false},"created_at":"2015-12-26T03:50:17Z","updated_at":"2015-12-26T03:50:17Z","body":"@santigimeno Judging from the stack trace you posted, it sure does seem like either `exit` fires before `disconnect` or else `disconnect` does not fire at all. But I am unable to reproduce this problem. I'm still trying, though. (I'm running a stress test on OS X right now.)\r\n\r\nI'd be reluctant to make a change like this without having a test that fails without the change and passes with it."}}