René's URL Explorer Experiment


Title: stream.pipeline destroys writable stream when error is occurred · Issue #26311 · nodejs/node · GitHub

Open Graph Title: stream.pipeline destroys writable stream when error is occurred · Issue #26311 · nodejs/node

X Title: stream.pipeline destroys writable stream when error is occurred · Issue #26311 · nodejs/node

Description: Version: v11.10.0 Platform: Mac OS Darwin 16.7.0 Subsystem: stream, http stream.pipeline is helpful to handle error and interoperable to Promise. However, I found a behavior that is not suitable my usecase. I am creating a web server wit...

Open Graph Description: Version: v11.10.0 Platform: Mac OS Darwin 16.7.0 Subsystem: stream, http stream.pipeline is helpful to handle error and interoperable to Promise. However, I found a behavior that is not suitable my...

X Description: Version: v11.10.0 Platform: Mac OS Darwin 16.7.0 Subsystem: stream, http stream.pipeline is helpful to handle error and interoperable to Promise. However, I found a behavior that is not suitable my...

Opengraph URL: https://github.com/nodejs/node/issues/26311

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"stream.pipeline destroys writable stream when error is occurred","articleBody":"\u003c!--\r\nThank you for reporting a possible bug in Node.js.\r\n\r\nPlease fill in as much of the template below as you can.\r\n\r\nVersion: output of `node -v`\r\nPlatform: output of `uname -a` (UNIX), or version and 32 or 64-bit (Windows)\r\nSubsystem: if known, please specify the affected core module name\r\n\r\nIf possible, please provide code that demonstrates the problem, keeping it as\r\nsimple and free of external dependencies as you can.\r\n-->\r\n\r\n* **Version**:\r\nv11.10.0\r\n\r\n* **Platform**:\r\nMac OS Darwin 16.7.0\r\n\r\n* **Subsystem**:\r\nstream, http\r\n\r\nstream.pipeline is helpful to handle error and interoperable to Promise.\r\nHowever, I found a behavior that is not suitable my usecase.\r\n\r\nI am creating a web server with stream.pipeline. \r\nIf my readable stream emits an error like \"file not found\", I would like to send `error` response to my clients.\r\n\r\ncode example is as follows.\r\n\r\n```javascript\r\nconst fs = require('fs')\r\nconst http = require('http')\r\nconst { pipeline } = require('stream')\r\n\r\nconst server = http.createServer((req, res) => {\r\n  const r = fs.createReadStream('./foo2.txt')\r\n  pipeline(r, res, (err) => {\r\n    if (err) {\r\n      console.log(err) // No such file\r\n      return res.end(\"error!!!\"); // write error response but this message is not shown.\r\n    }\r\n  })\r\n})\r\n\r\nserver.listen(9000)\r\n```\r\n\r\nI have investigated nodejs core, stream.pipeline destroys writable stream when error is occurred.\r\nhttps://github.com/nodejs/node/blob/master/lib/internal/streams/pipeline.js#L42\r\n\r\nso the above code cannot send error response. \r\n\r\n## Question\r\n\r\nIs this an expected behaviour? \r\nIn my understandings, writable stream should be closed anyway, but in this case, we would like to close writable stream manually.\r\n\r\nIn this situation, we need to create custom writable stream?\r\n\r\nI could send a PR to pass an option like `{ destroyOnError: false }` to avoid destory automatically.\r\n","author":{"url":"https://github.com/yosuke-furukawa","@type":"Person","name":"yosuke-furukawa"},"datePublished":"2019-02-26T06:13:08Z","url":"https://github.com/nodejs/node/issues/26311"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:9786617a-5462-c206-8feb-fcffb72b7a3c
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id881C:39A2F9:BB0D7F:F9BC86:6AED3C00
html-safe-nonced8a136b312e381929020c84de968d08d217cf71e1a6b1a2a0244fb6543c14b4f
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4ODFDOjM5QTJGOTpCQjBEN0Y6RjlCQzg2OjZBRUQzQzAwIiwidmlzaXRvcl9pZCI6IjkwNDgyNjExMTk1Njk2NDA0NDgiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac626d995a7e55eb3e98f0d57b9ce0c79f8b3415bcca646cabc478539f6b9c3f14
hovercard-subject-tagissue:414448477
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/nodejs/node/26311/issue_layout
twitter:imagehttps://opengraph.githubassets.com/a7f92fe2ab2e138865740ab547be5ae1dba20e0504e6f3c76a47aa3a97c7c6eb/nodejs/node/issues/26311
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/a7f92fe2ab2e138865740ab547be5ae1dba20e0504e6f3c76a47aa3a97c7c6eb/nodejs/node/issues/26311
og:image:altVersion: v11.10.0 Platform: Mac OS Darwin 16.7.0 Subsystem: stream, http stream.pipeline is helpful to handle error and interoperable to Promise. However, I found a behavior that is not suitable my...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameyosuke-furukawa
hostnamegithub.com
expected-hostnamegithub.com
None26c92a9388ddfad3fa88d132b5d5f0b4747030233dcc4e5efb05f1cbae152184
turbo-cache-controlno-preview
go-importgithub.com/nodejs/node git https://github.com/nodejs/node.git
octolytics-dimension-user_id9950313
octolytics-dimension-user_loginnodejs
octolytics-dimension-repository_id27193779
octolytics-dimension-repository_nwonodejs/node
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id27193779
octolytics-dimension-repository_network_root_nwonodejs/node
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releasec629ad99c254d306375fc8354d04321c2c362236
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/nodejs/node/issues/26311#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fnodejs%2Fnode%2Fissues%2F26311
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fnodejs%2Fnode%2Fissues%2F26311
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=nodejs%2Fnode
Reloadhttps://github.com/nodejs/node/issues/26311
Reloadhttps://github.com/nodejs/node/issues/26311
Reloadhttps://github.com/nodejs/node/issues/26311
nodejshttps://github.com/nodejs
nodehttps://github.com/nodejs/node
Codehttps://github.com/nodejs/node
Issues656 (656)https://github.com/nodejs/node/issues
Pull requests665 (665)https://github.com/nodejs/node/pulls
Actionshttps://github.com/nodejs/node/actions
Projectshttps://github.com/nodejs/node/projects
Security and qualityhttps://github.com/nodejs/node/security
Insightshttps://github.com/nodejs/node/pulse
https://github.com/nodejs/node
New issuehttps://github.com/login?return_to=https://github.com/nodejs/node/issues/26311
New issuehttps://github.com/login?return_to=https://github.com/nodejs/node/issues/26311
stream.pipeline destroys writable stream when error is occurredhttps://github.com/nodejs/node/issues/26311#top
feature requestIssues requesting new Node.js features.https://github.com/nodejs/node/issues?q=state%3Aopen%20label%3A%22feature%20request%22
staleIssues and PRs marked stale due to inactivity and scheduled for automatic closure.https://github.com/nodejs/node/issues?q=state%3Aopen%20label%3A%22stale%22
streamIssues and PRs related to Node.js streams.https://github.com/nodejs/node/issues?q=state%3Aopen%20label%3A%22stream%22
https://github.com/yosuke-furukawa
yosuke-furukawahttps://github.com/yosuke-furukawa
on Feb 26, 2019https://github.com/nodejs/node/issues/26311#issue-414448477
https://github.com/nodejs/node/blob/master/lib/internal/streams/pipeline.js#L42https://github.com/nodejs/node/blob/master/lib/internal/streams/pipeline.js#L42
Nexthttps://github.com/nodejs/node/issues/26311?timeline_page=1
https://github.com/mcollina
mcollinahttps://github.com/mcollina
on Feb 28, 2019https://github.com/nodejs/node/issues/26311#issuecomment-468485652
https://github.com/yosuke-furukawa
yosuke-furukawahttps://github.com/yosuke-furukawa
on Mar 1, 2019https://github.com/nodejs/node/issues/26311#issuecomment-468519708
https://github.com/mcollina
mcollinahttps://github.com/mcollina
on Mar 2, 2019https://github.com/nodejs/node/issues/26311#issuecomment-468909153
lpincahttps://github.com/lpinca
streamIssues and PRs related to Node.js streams.https://github.com/nodejs/node/issues?q=state%3Aopen%20label%3A%22stream%22
on Mar 3, 2019https://github.com/nodejs/node/issues/26311#event-2176218369
https://github.com/yosuke-furukawa
yosuke-furukawahttps://github.com/yosuke-furukawa
on Mar 4, 2019https://github.com/nodejs/node/issues/26311#issuecomment-469135710
https://nodejs.org/api/stream.html#stream_stream_finished_stream_options_callbackhttps://nodejs.org/api/stream.html#stream_stream_finished_stream_options_callback
https://github.com/mcollina
mcollinahttps://github.com/mcollina
on Mar 4, 2019https://github.com/nodejs/node/issues/26311#issuecomment-469252387
https://github.com/kharandziuk
kharandziukhttps://github.com/kharandziuk
on Jul 3, 2019https://github.com/nodejs/node/issues/26311#issuecomment-507898067
@yosuke-furukawahttps://github.com/yosuke-furukawa
@mcollinahttps://github.com/mcollina
https://github.com/mcollina
mcollinahttps://github.com/mcollina
on Jul 3, 2019https://github.com/nodejs/node/issues/26311#issuecomment-508032176
https://github.com/kharandziuk
kharandziukhttps://github.com/kharandziuk
on Jul 3, 2019https://github.com/nodejs/node/issues/26311#issuecomment-508124132
@yosuke-furukawahttps://github.com/yosuke-furukawa
https://github.com/mcollina
mcollinahttps://github.com/mcollina
on Jul 4, 2019https://github.com/nodejs/node/issues/26311#issuecomment-508477212
https://www.npmjs.com/package/sendhttps://www.npmjs.com/package/send
https://github.com/kharandziuk
kharandziukhttps://github.com/kharandziuk
on Jul 4, 2019https://github.com/nodejs/node/issues/26311#issuecomment-508483023
@yosuke-furukawahttps://github.com/yosuke-furukawa
@mafintoshhttps://github.com/mafintosh
jasnellhttps://github.com/jasnell
feature requestIssues requesting new Node.js features.https://github.com/nodejs/node/issues?q=state%3Aopen%20label%3A%22feature%20request%22
on Jun 26, 2020https://github.com/nodejs/node/issues/26311#event-3484760263
https://github.com/rickyes
rickyeshttps://github.com/rickyes
on Jun 28, 2020https://github.com/nodejs/node/issues/26311#issuecomment-650725745
https://github.com/mcollina
mcollinahttps://github.com/mcollina
on Jun 28, 2020https://github.com/nodejs/node/issues/26311#issuecomment-650726107
https://github.com/ronag
ronaghttps://github.com/ronag
on Jul 1, 2020https://github.com/nodejs/node/issues/26311#issuecomment-652522158
https://github.com/mcollina
mcollinahttps://github.com/mcollina
on Dec 4, 2021https://github.com/nodejs/node/issues/26311#issuecomment-986012895
#34133https://github.com/nodejs/node/pull/34133
#34133https://github.com/nodejs/node/pull/34133
https://github.com/RafaelGSS
RafaelGSShttps://github.com/RafaelGSS
on Dec 4, 2021https://github.com/nodejs/node/issues/26311#issuecomment-986035089
#34133https://github.com/nodejs/node/pull/34133
https://github.com/mcollina
mcollinahttps://github.com/mcollina
on Dec 4, 2021https://github.com/nodejs/node/issues/26311#issuecomment-986051988
@ronaghttps://github.com/ronag
https://github.com/ronag
ronaghttps://github.com/ronag
on Dec 4, 2021https://github.com/nodejs/node/issues/26311#issuecomment-986085235
https://github.com/rickyes
rickyeshttps://github.com/rickyes
on Dec 5, 2021https://github.com/nodejs/node/issues/26311#issuecomment-986146404
targoshttps://github.com/targos
Node.js feature requestshttps://github.com/orgs/nodejs/projects/4
on Apr 4, 2022https://github.com/nodejs/node/issues/26311#event-15228794012
targoshttps://github.com/targos
Node.js feature requestshttps://github.com/orgs/nodejs/projects/4
on Apr 4, 2022https://github.com/nodejs/node/issues/26311
https://github.com/apps/github-actions
github-actionshttps://github.com/apps/github-actions
on Jun 3, 2022https://github.com/nodejs/node/issues/26311#issuecomment-1145501755
feature request management documenthttps://github.com/nodejs/node/blob/HEAD/doc/contributing/feature-request-management.md
github-actionshttps://github.com/apps/github-actions
staleIssues and PRs marked stale due to inactivity and scheduled for automatic closure.https://github.com/nodejs/node/issues?q=state%3Aopen%20label%3A%22stale%22
on Jun 3, 2022https://github.com/nodejs/node/issues/26311#event-6732866343
https://github.com/RafaelGSS
RafaelGSShttps://github.com/RafaelGSS
on Jun 3, 2022https://github.com/nodejs/node/issues/26311#issuecomment-1145513508
#41796https://github.com/nodejs/node/pull/41796
RafaelGSShttps://github.com/RafaelGSS
completedhttps://github.com/nodejs/node/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
on Jun 3, 2022https://github.com/nodejs/node/issues/26311#event-6732981006
targoshttps://github.com/targos
Node.js feature requestshttps://github.com/orgs/nodejs/projects/4
on Apr 4, 2023https://github.com/nodejs/node/issues/26311
avivkellerhttps://github.com/avivkeller
Node.js feature requestshttps://github.com/orgs/nodejs/projects/4
on Jun 26, 2024https://github.com/nodejs/node/issues/26311
https://github.com/Lordfirespeed
Lordfirespeedhttps://github.com/Lordfirespeed
on Aug 10, 2024https://github.com/nodejs/node/issues/26311#issuecomment-2282277656
Lordfirespeedhttps://github.com/Lordfirespeed
on Aug 10, 2024https://github.com/nodejs/node/issues/26311#event-13829381053
fix(send): nodejs/node#26311https://github.com/OtterJS/otterhttp/commit/4e55acdad3a1a343fcace1e55fb99879ce7b0bab
nodejs/node#26311https://github.com/nodejs/node/issues/26311
4e55acdhttps://github.com/OtterJS/otterhttp/commit/4e55acdad3a1a343fcace1e55fb99879ce7b0bab
Sign up for freehttps://github.com/signup?return_to=https://github.com/nodejs/node/issues/26311
Sign in to commenthttps://github.com/login?return_to=https://github.com/nodejs/node/issues/26311
feature requestIssues requesting new Node.js features.https://github.com/nodejs/node/issues?q=state%3Aopen%20label%3A%22feature%20request%22
staleIssues and PRs marked stale due to inactivity and scheduled for automatic closure.https://github.com/nodejs/node/issues?q=state%3Aopen%20label%3A%22stale%22
streamIssues and PRs related to Node.js streams.https://github.com/nodejs/node/issues?q=state%3Aopen%20label%3A%22stream%22
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.