{"action":"created","issue":{"url":"https://api.github.com/repos/nodejs/node/issues/6164","repository_url":"https://api.github.com/repos/nodejs/node","labels_url":"https://api.github.com/repos/nodejs/node/issues/6164/labels{/name}","comments_url":"https://api.github.com/repos/nodejs/node/issues/6164/comments","events_url":"https://api.github.com/repos/nodejs/node/issues/6164/events","html_url":"https://github.com/nodejs/node/pull/6164","id":147706579,"number":6164,"title":"streams: support unlimited synchronous cork/uncork cycles","user":{"login":"mcollina","id":52195,"avatar_url":"https://avatars.githubusercontent.com/u/52195?v=3","gravatar_id":"","url":"https://api.github.com/users/mcollina","html_url":"https://github.com/mcollina","followers_url":"https://api.github.com/users/mcollina/followers","following_url":"https://api.github.com/users/mcollina/following{/other_user}","gists_url":"https://api.github.com/users/mcollina/gists{/gist_id}","starred_url":"https://api.github.com/users/mcollina/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mcollina/subscriptions","organizations_url":"https://api.github.com/users/mcollina/orgs","repos_url":"https://api.github.com/users/mcollina/repos","events_url":"https://api.github.com/users/mcollina/events{/privacy}","received_events_url":"https://api.github.com/users/mcollina/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/nodejs/node/labels/lts-watch-v4.x","name":"lts-watch-v4.x","color":"eb6420"},{"url":"https://api.github.com/repos/nodejs/node/labels/stream","name":"stream","color":"c7def8"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":10,"created_at":"2016-04-12T10:37:50Z","updated_at":"2016-04-12T14:28:36Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/nodejs/node/pulls/6164","html_url":"https://github.com/nodejs/node/pull/6164","diff_url":"https://github.com/nodejs/node/pull/6164.diff","patch_url":"https://github.com/nodejs/node/pull/6164.patch"},"body":"##### Checklist\r\n\r\n- [x] tests and code linting passes\r\n- [x] a test and/or benchmark is included\r\n\r\n\r\n##### Affected core subsystem(s)\r\n\r\nstreams, writable\r\n\r\n##### Description of change\r\n\r\nnet streams can request multiple chunks to be written in a synchronous\r\nfashion. If this is combined with cork/uncork, en error is currently\r\nthrown because of a regression introduced in:\r\nhttps://github.com/nodejs/node/commit/89aeab901ac9e34c79be3854f1aa41f2a4fb6888\r\n(https://github.com/nodejs/node/pull/4354).\r\n\r\nI am not creating a full linked list anyway, because that is not needed in any \"normal\" operation of the stream, and I think multiple cork/uncork synchronously it is a very edge case: we can possibly waste some objects and callbacks. \r\nJust to clarify, we are supporting a \"feature\" that can easily lead to event loop starvation and memory leaks, because for each synchronous cork/uncork cycle, we are adding a task in the `nextTick` queue:  https://github.com/nodejs/node/blob/819b2d36bcffdb9f33e0e4497ac818d64fe5711d/lib/_stream_writable.js#L344.\r\n\r\nFixes: https://github.com/nodejs/node/issues/6154."},"comment":{"url":"https://api.github.com/repos/nodejs/node/issues/comments/208934201","html_url":"https://github.com/nodejs/node/pull/6164#issuecomment-208934201","issue_url":"https://api.github.com/repos/nodejs/node/issues/6164","id":208934201,"user":{"login":"jfhbrook","id":57536,"avatar_url":"https://avatars.githubusercontent.com/u/57536?v=3","gravatar_id":"","url":"https://api.github.com/users/jfhbrook","html_url":"https://github.com/jfhbrook","followers_url":"https://api.github.com/users/jfhbrook/followers","following_url":"https://api.github.com/users/jfhbrook/following{/other_user}","gists_url":"https://api.github.com/users/jfhbrook/gists{/gist_id}","starred_url":"https://api.github.com/users/jfhbrook/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jfhbrook/subscriptions","organizations_url":"https://api.github.com/users/jfhbrook/orgs","repos_url":"https://api.github.com/users/jfhbrook/repos","events_url":"https://api.github.com/users/jfhbrook/events{/privacy}","received_events_url":"https://api.github.com/users/jfhbrook/received_events","type":"User","site_admin":false},"created_at":"2016-04-12T14:28:36Z","updated_at":"2016-04-12T14:28:36Z","body":"> @jfhbrook are you able to test this?\r\n\r\nA little hard because we're only seeing this in production, but I'll see what we can do."}}