{"action":"created","issue":{"url":"https://api.github.com/repos/nodejs/node/issues/7974","repository_url":"https://api.github.com/repos/nodejs/node","labels_url":"https://api.github.com/repos/nodejs/node/issues/7974/labels{/name}","comments_url":"https://api.github.com/repos/nodejs/node/issues/7974/comments","events_url":"https://api.github.com/repos/nodejs/node/issues/7974/events","html_url":"https://github.com/nodejs/node/issues/7974","id":169301628,"number":7974,"title":"Children from child_process.fork printing outside of parent after parent process.exit","user":{"login":"METACEO","id":13586713,"avatar_url":"https://avatars.githubusercontent.com/u/13586713?v=3","gravatar_id":"","url":"https://api.github.com/users/METACEO","html_url":"https://github.com/METACEO","followers_url":"https://api.github.com/users/METACEO/followers","following_url":"https://api.github.com/users/METACEO/following{/other_user}","gists_url":"https://api.github.com/users/METACEO/gists{/gist_id}","starred_url":"https://api.github.com/users/METACEO/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/METACEO/subscriptions","organizations_url":"https://api.github.com/users/METACEO/orgs","repos_url":"https://api.github.com/users/METACEO/repos","events_url":"https://api.github.com/users/METACEO/events{/privacy}","received_events_url":"https://api.github.com/users/METACEO/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/nodejs/node/labels/child_process","name":"child_process","color":"f7c6c7"},{"url":"https://api.github.com/repos/nodejs/node/labels/question","name":"question","color":"cc317c"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-08-04T06:38:01Z","updated_at":"2016-08-04T09:28:27Z","closed_at":null,"body":"* **Version**: v6.3.1\r\n* **Platform**: Linux 3.10.0-327.28.2.el7.x86_64\r\n* **Subsystem**: child_process\r\n\r\nMy example demonstrates - what I believe to be - a frustrating extreme to what could be an underlying issue. Copy together the two examples below into the same directory (name the top `parent.js` and the bottom `child.js` - for reproducing's sake.) Open two terminals (the first will become difficult to use...) and run `node parent.js` with the first and wait. While your node application will close, you'll continue to be hit with the `console.log` from the forked process. This will continue until you kill the child process manually (which, again, can be difficult with the first terminal) so run `ps aux | grep \"node child.js\"` with your second terminal, find the forked child's PID and kill it.\r\n\r\nThe prints will not happen if `child.js` is forked with a true silent option or if you exit `parent.js` with `Ctrl+C` - so I don't know if this is a leak of the child's scope or if this is intentional and by design.\r\n\r\n```javascript\r\n/* parent.js */\r\n\r\n// create a child:\r\nrequire(\"child_process\").fork(\"child.js\")\r\n\r\n// exit after a couple of seconds:\r\nsetTimeout(process.exit, 2000)\r\n```\r\n\r\n```javascript\r\n/* child.js */\r\n\r\n// call every second:\r\nsetInterval(() => console.log(new Date),1000)\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/nodejs/node/issues/comments/237501513","html_url":"https://github.com/nodejs/node/issues/7974#issuecomment-237501513","issue_url":"https://api.github.com/repos/nodejs/node/issues/7974","id":237501513,"user":{"login":"addaleax","id":899444,"avatar_url":"https://avatars.githubusercontent.com/u/899444?v=3","gravatar_id":"","url":"https://api.github.com/users/addaleax","html_url":"https://github.com/addaleax","followers_url":"https://api.github.com/users/addaleax/followers","following_url":"https://api.github.com/users/addaleax/following{/other_user}","gists_url":"https://api.github.com/users/addaleax/gists{/gist_id}","starred_url":"https://api.github.com/users/addaleax/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/addaleax/subscriptions","organizations_url":"https://api.github.com/users/addaleax/orgs","repos_url":"https://api.github.com/users/addaleax/repos","events_url":"https://api.github.com/users/addaleax/events{/privacy}","received_events_url":"https://api.github.com/users/addaleax/received_events","type":"User","site_admin":false},"created_at":"2016-08-04T09:28:27Z","updated_at":"2016-08-04T09:28:27Z","body":"That sounds like the expected behaviour to me, maybe the conversation in https://github.com/nodejs/node/issues/7951#issuecomment-237031167 clarifies things a little, too?"}}
{"actor":{"display_login":"addaleax"}}