Title: Piping readable stream to multiple writeable streams results in crash · Issue #5820 · nodejs/node · GitHub
Open Graph Title: Piping readable stream to multiple writeable streams results in crash · Issue #5820 · nodejs/node
X Title: Piping readable stream to multiple writeable streams results in crash · Issue #5820 · nodejs/node
Description: If I execute the following code snippet in node >= 4.2.0, it results in the read stream reading the data very fast but not being able to write them out to wr2 equally fast. The memory usage of the process increases very fast until the pr...
Open Graph Description: If I execute the following code snippet in node >= 4.2.0, it results in the read stream reading the data very fast but not being able to write them out to wr2 equally fast. The memory usage of the ...
X Description: If I execute the following code snippet in node >= 4.2.0, it results in the read stream reading the data very fast but not being able to write them out to wr2 equally fast. The memory usage of t...
Opengraph URL: https://github.com/nodejs/node/issues/5820
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Piping readable stream to multiple writeable streams results in crash","articleBody":"If I execute the following code snippet in node \u003e= 4.2.0, it results in the read stream reading the data very fast but not being able to write them out to wr2 equally fast. The memory usage of the process increases very fast until the process exits with an error.\n\n``` js\nvar fs = require('fs');\n\n//M: and L: are local disks with fast read and write\n// the .mov file is several gigabytes in size\nvar rd = fs.createReadStream('M:/A007C003_141024_R7C6.mov');\nvar wr = fs.createWriteStream('L:/A007C003_141024_R7C6.mov');\n\n//N: is a NAS drive, slow\nvar wr2 = fs.createWriteStream('N:/A007C003_141024_R7C6.mov');\n\n//read from fast disk, write to both fast and slow disk\nrd.pipe(wr);\nrd.pipe(wr2);\n```\n\nThe script ends with this error:\n\n```\n.\\node-4.2.0 test.js\nbuffer.js:98\n const ui8 = new Uint8Array(size);\n ^\n\nRangeError: Invalid array buffer length\n at new ArrayBuffer (native)\n at new Uint8Array (native)\n at allocate (buffer.js:98:17)\n at new Buffer (buffer.js:49:12)\n at Function.Buffer.concat (buffer.js:234:16)\n at fromList (_stream_readable.js:840:20)\n at ReadStream.Readable.read (_stream_readable.js:339:11)\n at flow (_stream_readable.js:743:26)\n at WriteStream.\u003canonymous\u003e (_stream_readable.js:601:7)\n at emitNone (events.js:67:13)\n at WriteStream.emit (events.js:166:7)\n```\n\nEarlier versions of node (4.1.2 and below) do not show the same behaviour. \n- **Version**: v4.2.0\n- **Platform**: Win10 64bit\n- **Subsystem**: \n","author":{"url":"https://github.com/kr3l","@type":"Person","name":"kr3l"},"datePublished":"2016-03-21T14:13:19.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":7},"url":"https://github.com/5820/node/issues/5820"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:0669a8df-4e5b-71d6-559a-b5fe6c40679b |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A034:490E8:17413D8:2058713:6A4DF71D |
| html-safe-nonce | 39513f00302c7b46f356974f11a341b874af64ee4666c93f31a503563cb2b537 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBMDM0OjQ5MEU4OjE3NDEzRDg6MjA1ODcxMzo2QTRERjcxRCIsInZpc2l0b3JfaWQiOiI1ODI0ODk4NDU0NjUyODQzODA1IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 7a6572294bbdea396bd65900c3cb7990044b20ed3c0415830db7d386c5ab2968 |
| hovercard-subject-tag | issue:142360384 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/nodejs/node/5820/issue_layout |
| twitter:image | https://opengraph.githubassets.com/3fd575332372de261f4f871eb3d209e413c27dfd4716f1271cb769b34b3c68ee/nodejs/node/issues/5820 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/3fd575332372de261f4f871eb3d209e413c27dfd4716f1271cb769b34b3c68ee/nodejs/node/issues/5820 |
| og:image:alt | If I execute the following code snippet in node >= 4.2.0, it results in the read stream reading the data very fast but not being able to write them out to wr2 equally fast. The memory usage of the ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | kr3l |
| hostname | github.com |
| expected-hostname | github.com |
| None | 5818716c93c6a2925b815402541a32814e43a7b1261c322b0c2df75224289566 |
| turbo-cache-control | no-preview |
| go-import | github.com/nodejs/node git https://github.com/nodejs/node.git |
| octolytics-dimension-user_id | 9950313 |
| octolytics-dimension-user_login | nodejs |
| octolytics-dimension-repository_id | 27193779 |
| octolytics-dimension-repository_nwo | nodejs/node |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 27193779 |
| octolytics-dimension-repository_network_root_nwo | nodejs/node |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | f4bb89367ca678f057d79b1abc45d6675b1bd5b2 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width