{"action":"created","issue":{"url":"https://api.github.com/repos/nodejs/node/issues/12921","repository_url":"https://api.github.com/repos/nodejs/node","labels_url":"https://api.github.com/repos/nodejs/node/issues/12921/labels{/name}","comments_url":"https://api.github.com/repos/nodejs/node/issues/12921/comments","events_url":"https://api.github.com/repos/nodejs/node/issues/12921/events","html_url":"https://github.com/nodejs/node/issues/12921","id":227388184,"number":12921,"title":"stdout always cuts off the stream at character 8192","user":{"login":"aight8","id":1138623,"avatar_url":"https://avatars3.githubusercontent.com/u/1138623?v=3","gravatar_id":"","url":"https://api.github.com/users/aight8","html_url":"https://github.com/aight8","followers_url":"https://api.github.com/users/aight8/followers","following_url":"https://api.github.com/users/aight8/following{/other_user}","gists_url":"https://api.github.com/users/aight8/gists{/gist_id}","starred_url":"https://api.github.com/users/aight8/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aight8/subscriptions","organizations_url":"https://api.github.com/users/aight8/orgs","repos_url":"https://api.github.com/users/aight8/repos","events_url":"https://api.github.com/users/aight8/events{/privacy}","received_events_url":"https://api.github.com/users/aight8/received_events","type":"User","site_admin":false},"labels":[{"id":155267478,"url":"https://api.github.com/repos/nodejs/node/labels/child_process","name":"child_process","color":"f7c6c7","default":false},{"id":235508847,"url":"https://api.github.com/repos/nodejs/node/labels/macos","name":"macos","color":"9944dd","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":10,"created_at":"2017-05-09T14:35:48Z","updated_at":"2017-05-11T09:23:00Z","closed_at":null,"body":"Using ```fork```, ```spawn```, ```exec``` in **async** and **sync** mode - stdout stream only returns up to 8192 characters. (note that the output is **without** any newlines)\r\nNote that ```maxBuffer``` **does not** let increase this maximum. But it's possible to lower it by setting it to a value below 8192.\r\n\r\n* **Version**: 7.10 / 7.9\r\n* **Platform**: macOC Sierra 10.12.5\r\n\r\n<!-- Enter your issue details below this comment. -->\r\n"},"comment":{"url":"https://api.github.com/repos/nodejs/node/issues/comments/300733885","html_url":"https://github.com/nodejs/node/issues/12921#issuecomment-300733885","issue_url":"https://api.github.com/repos/nodejs/node/issues/12921","id":300733885,"user":{"login":"santigimeno","id":1084056,"avatar_url":"https://avatars1.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},"created_at":"2017-05-11T09:23:00Z","updated_at":"2017-05-11T09:23:00Z","body":"The problem seems to be that `stdout` is non-blocking. From [process.exit() documentation](https://nodejs.org/dist/latest-v7.x/docs/api/process.html#process_process_exit_code):\r\n\r\n> It is important to note that calling process.exit() will force the process to exit as quickly as possible even if there are still asynchronous operations pending that have not yet completed fully, including I/O operations to process.stdout and process.stderr.\r\n\r\nThis is a test case that reproduces the error:\r\n```js\r\nconst cp = require('child_process');\r\n\r\nif (process.argv[2] === 'child') {\r\n  console.log('g'.repeat(81933).toString());\r\n  process.exit();\r\n} else {\r\n  const child = cp.spawn(process.execPath, [__filename, 'child']);\r\n  child.stdout.pipe(process.stdout);\r\n}\r\n```\r\n\r\nI guess yarn is calling process.exit() before waiting the data to be written out."}}
{"actor":{"display_login":"santigimeno"}}