{"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":151728674,"url":"https://api.github.com/repos/nodejs/node/labels/confirmed-bug","name":"confirmed-bug","color":"fc2929","default":false},{"id":235508847,"url":"https://api.github.com/repos/nodejs/node/labels/macos","name":"macos","color":"9944dd","default":false},{"id":207521371,"url":"https://api.github.com/repos/nodejs/node/labels/process","name":"process","color":"00aaff","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":19,"created_at":"2017-05-09T14:35:48Z","updated_at":"2017-05-13T15:20:36Z","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/301254830","html_url":"https://github.com/nodejs/node/issues/12921#issuecomment-301254830","issue_url":"https://api.github.com/repos/nodejs/node/issues/12921","id":301254830,"user":{"login":"gireeshpunathil","id":6447530,"avatar_url":"https://avatars1.githubusercontent.com/u/6447530?v=3","gravatar_id":"","url":"https://api.github.com/users/gireeshpunathil","html_url":"https://github.com/gireeshpunathil","followers_url":"https://api.github.com/users/gireeshpunathil/followers","following_url":"https://api.github.com/users/gireeshpunathil/following{/other_user}","gists_url":"https://api.github.com/users/gireeshpunathil/gists{/gist_id}","starred_url":"https://api.github.com/users/gireeshpunathil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gireeshpunathil/subscriptions","organizations_url":"https://api.github.com/users/gireeshpunathil/orgs","repos_url":"https://api.github.com/users/gireeshpunathil/repos","events_url":"https://api.github.com/users/gireeshpunathil/events{/privacy}","received_events_url":"https://api.github.com/users/gireeshpunathil/received_events","type":"User","site_admin":false},"created_at":"2017-05-13T15:20:36Z","updated_at":"2017-05-13T15:20:36Z","body":"@bnoordhuis - I reproduced the same issue in Linux as well, though with a larger data volume (1MB):\r\n\r\n```trace\r\n[pid 24092] write(1, \"gggggggggggggggggggggggggggggggg\"..., 1048576 <unfinished ...>\r\n[pid 24086] <... epoll_wait resumed> {{EPOLLIN, {u32=12, u64=12}}}, 1024, 4294967295) = 1\r\n[pid 24086] read(12,  <unfinished ...>\r\n[pid 24092] <... write resumed> )       = 128000\r\n...\r\n[pid 24092] munmap(0x7fb52c504000, 3149824 <unfinished ...>\r\n[pid 24086] <... read resumed> \"gggggggggggggggggggggggggggggggg\"..., 65536) = 65536\r\n...\r\n[pid 24086] read(12, \"gggggggggggggggggggggggggggggggg\"..., 65536) = 62464\r\n\r\n```\r\nAs you can see, the write from the child happened only once - which was read by the parent in two iterations. However, note that the single write by the child is still not complete. The child seems to have attempted to write only once, ignoring how much it has actually written.\r\n\r\nmanual page of write (mac) says:\r\n\r\n```\r\nWhen using non-blocking I/O on objects, such as sockets, that are subject to flow control,\r\n     write() and writev() may write fewer bytes than requested; the return value must be noted, and\r\n     the remainder of the operation should be retried when possible.\r\n```\r\n\r\nand I don't see an evidence of node re-attempting on fewer writes."}}
{"actor":{"display_login":"gireeshpunathil"}}