René's URL Explorer Experiment


Title: Stream finished does not always work with http incoming message · Issue #38657 · nodejs/node · GitHub

Open Graph Title: Stream finished does not always work with http incoming message · Issue #38657 · nodejs/node

X Title: Stream finished does not always work with http incoming message · Issue #38657 · nodejs/node

Description: Version: v15.12.0 Platform: Darwin Kernel Version 20.3.0 Subsystem: http What steps will reproduce the bug? The stream.finished never resolves or rejects when applied onto a destroyed incoming message like in example below. It finishes f...

Open Graph Description: Version: v15.12.0 Platform: Darwin Kernel Version 20.3.0 Subsystem: http What steps will reproduce the bug? The stream.finished never resolves or rejects when applied onto a destroyed incoming mess...

X Description: Version: v15.12.0 Platform: Darwin Kernel Version 20.3.0 Subsystem: http What steps will reproduce the bug? The stream.finished never resolves or rejects when applied onto a destroyed incoming mess...

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

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Stream finished does not always work with http incoming message","articleBody":"* **Version**: v15.12.0\n* **Platform**: Darwin Kernel Version 20.3.0\n* **Subsystem**: http\n\n### What steps will reproduce the bug?\n\nThe `stream.finished` never resolves or rejects when applied onto a destroyed incoming message like in example below. It finishes for example when applied on a destroyed file stream. Also it finishes when the line with `await new Promise(r => setTimeout(r, 1000));` is commented. This looks really inconsistent.\n\n``` js\nlet http = require(\"http\");\nlet { finished } = require(\"stream/promises\");\n\nlet server = http.createServer(async function(req, res)\n{\n\tfor await (let chunk of req) break;\n\tawait new Promise(r => setTimeout(r, 1000));\n\tconsole.log(\"waiting\");\n\tawait finished(req);\n\tconsole.log(\"sending\");\n\tres.end();\n});\n\n(async function()\n{\n\tawait new Promise(resolve => server.listen(resolve));\n\tlet req = http.request({ port: server.address().port, method: \"post\" }).end(\"abc\");\n\ttry\n\t{\n\t\tlet res = await new Promise((resolve, reject) => req.on(\"response\", resolve).on(\"error\", reject));\n\t\tawait finished(res.resume());\n\t}\n\tcatch(e)\n\t{\n\t\tconsole.log(e);\n\t}\n}());\n```\n\n### How often does it reproduce? Is there a required condition?\n\nAlways.\n\n### What is the expected behavior?\n\n```\nError: socket hang up\nwaiting\nsending\n```\n\n### What do you see instead?\n\n```\nError: socket hang up\nwaiting\n```\n","author":{"url":"https://github.com/misos1","@type":"Person","name":"misos1"},"datePublished":"2021-05-12T19:46:57Z","url":"https://github.com/nodejs/node/issues/38657"}

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:379a32be-f908-cd35-ff99-dfc6312c594f
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idCC30:2BD59E:70C475:990ADE:6AED29D5
html-safe-nonce717c3562e20779607c790b80d601b70758c91a99343c4eccce80d4f9d2d6be04
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDQzMwOjJCRDU5RTo3MEM0NzU6OTkwQURFOjZBRUQyOUQ1IiwidmlzaXRvcl9pZCI6IjYwMjQyNTMzMDQ0ODcwOTQ3NDIiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmacdd65b5223e6f2a58fe81e148bf18c19ac1f875c1b0abbe3eca9c4faf86b267f8
hovercard-subject-tagissue:890429515
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/38657/issue_layout
twitter:imagehttps://opengraph.githubassets.com/9227c5d40f4bf2e2dbeb5efa4ea0e73899a00231e8cff7d720229656d64f3d6a/nodejs/node/issues/38657
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/9227c5d40f4bf2e2dbeb5efa4ea0e73899a00231e8cff7d720229656d64f3d6a/nodejs/node/issues/38657
og:image:altVersion: v15.12.0 Platform: Darwin Kernel Version 20.3.0 Subsystem: http What steps will reproduce the bug? The stream.finished never resolves or rejects when applied onto a destroyed incoming mess...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamemisos1
hostnamegithub.com
expected-hostnamegithub.com
None9d95365dda0576efe9b71f45807595e396bd0ca9286fba5367a05048e6ddf8f2
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
release98b41fa4b5635ceb45a4c54320fced73817ff290
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/nodejs/node/issues/38657#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fnodejs%2Fnode%2Fissues%2F38657
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%2F38657
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/38657
Reloadhttps://github.com/nodejs/node/issues/38657
Reloadhttps://github.com/nodejs/node/issues/38657
nodejshttps://github.com/nodejs
nodehttps://github.com/nodejs/node
Codehttps://github.com/nodejs/node
Issues656 (656)https://github.com/nodejs/node/issues
Pull requests666 (666)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/38657
New issuehttps://github.com/login?return_to=https://github.com/nodejs/node/issues/38657
Stream finished does not always work with http incoming messagehttps://github.com/nodejs/node/issues/38657#top
streamIssues and PRs related to Node.js streams.https://github.com/nodejs/node/issues?q=state%3Aopen%20label%3A%22stream%22
https://github.com/misos1
misos1https://github.com/misos1
on May 12, 2021https://github.com/nodejs/node/issues/38657#issue-890429515
Nexthttps://github.com/nodejs/node/issues/38657?timeline_page=1
https://github.com/Linkgoron
Linkgoronhttps://github.com/Linkgoron
on May 12, 2021https://github.com/nodejs/node/issues/38657#issuecomment-840147193
Linkgoronhttps://github.com/Linkgoron
on May 12, 2021https://github.com/nodejs/node/issues/38657#event-4739190881
test: stream.finished detects a destroyed IncomingMessagehttps://github.com/Linkgoron/node/commit/c9bc54d47a0c882b8c3961b1cbe6602f970bad1c
c9bc54dhttps://github.com/Linkgoron/node/commit/c9bc54d47a0c882b8c3961b1cbe6602f970bad1c
https://github.com/Linkgoron
Linkgoronhttps://github.com/Linkgoron
on May 12, 2021https://github.com/nodejs/node/issues/38657#issuecomment-840173283
https://github.com/misos1
misos1https://github.com/misos1
on May 13, 2021https://github.com/nodejs/node/issues/38657#issuecomment-840672177
https://github.com/Linkgoron
Linkgoronhttps://github.com/Linkgoron
on May 13, 2021https://github.com/nodejs/node/issues/38657#issuecomment-840709072
#33035https://github.com/nodejs/node/pull/33035
#33035https://github.com/nodejs/node/pull/33035
https://github.com/mcollina
mcollinahttps://github.com/mcollina
on May 16, 2021https://github.com/nodejs/node/issues/38657#issuecomment-841796571
https://github.com/mcollina
mcollinahttps://github.com/mcollina
on May 16, 2021https://github.com/nodejs/node/issues/38657#issuecomment-841797557
@dnluphttps://github.com/dnlup
@ronaghttps://github.com/ronag
https://github.com/spazmodius
spazmodiushttps://github.com/spazmodius
on May 16, 2021https://github.com/nodejs/node/issues/38657#issuecomment-841842791
https://github.com/benjamingr
benjamingrhttps://github.com/benjamingr
on May 16, 2021https://github.com/nodejs/node/issues/38657#issuecomment-841845407
https://github.com/spazmodius
spazmodiushttps://github.com/spazmodius
on May 16, 2021https://github.com/nodejs/node/issues/38657#issuecomment-841848384
@benjamingrhttps://github.com/benjamingr
@mcollinahttps://github.com/mcollina
https://github.com/ronag
ronaghttps://github.com/ronag
on May 16, 2021https://github.com/nodejs/node/issues/38657#issuecomment-841849739
https://github.com/misos1
misos1https://github.com/misos1
on May 16, 2021https://github.com/nodejs/node/issues/38657#issuecomment-841850282
https://github.com/spazmodius
spazmodiushttps://github.com/spazmodius
on May 16, 2021https://github.com/nodejs/node/issues/38657#issuecomment-841850436
@ronaghttps://github.com/ronag
https://github.com/mcollina
mcollinahttps://github.com/mcollina
on May 16, 2021https://github.com/nodejs/node/issues/38657#issuecomment-841850722
@jasnellhttps://github.com/jasnell
https://youtu.be/XV-u_Ow47s0https://youtu.be/XV-u_Ow47s0
https://github.com/misos1
misos1https://github.com/misos1
on May 16, 2021https://github.com/nodejs/node/issues/38657#issuecomment-841852459
https://github.com/mcollina
mcollinahttps://github.com/mcollina
on May 17, 2021https://github.com/nodejs/node/issues/38657#issuecomment-842094321
jasnellhttps://github.com/jasnell
on May 17, 2021https://github.com/nodejs/node/issues/38657#event-4756508295
test: stream.finished detects a destroyed IncomingMessagehttps://github.com/nodejs/node/commit/cbe0f0959e5b558d533ec8d660a09f0b81fcfeed
cbe0f09https://github.com/nodejs/node/commit/cbe0f0959e5b558d533ec8d660a09f0b81fcfeed
https://github.com/misos1
misos1https://github.com/misos1
on May 17, 2021https://github.com/nodejs/node/issues/38657#issuecomment-842650199
https://github.com/mcollina
mcollinahttps://github.com/mcollina
on May 18, 2021https://github.com/nodejs/node/issues/38657#issuecomment-842932273
targoshttps://github.com/targos
on May 18, 2021https://github.com/nodejs/node/issues/38657#event-4759998658
test: stream.finished detects a destroyed IncomingMessagehttps://github.com/nodejs/node/commit/8eea3172271cbd021ae2f6d5881e4af6480bb3e9
8eea317https://github.com/nodejs/node/commit/8eea3172271cbd021ae2f6d5881e4af6480bb3e9
https://github.com/bizob2828
bizob2828https://github.com/bizob2828
on May 18, 2021https://github.com/nodejs/node/issues/38657#issuecomment-843592547
apollo-server-hapi pluginhttps://github.com/apollographql/apollo-server/tree/main/packages/apollo-server-hapi
request context to nullhttps://github.com/hapijs/hapi/blob/master/lib/request.js#L721
event handlerhttps://github.com/hapijs/hapi/blob/master/lib/request.js#L312
https://github.com/bizob2828/apollo-hapi-nr-testhttps://github.com/bizob2828/apollo-hapi-nr-test
https://user-images.githubusercontent.com/1874937/118728515-4ad74780-b802-11eb-8c84-c28028c838d5.png
https://github.com/misos1
misos1https://github.com/misos1
on May 20, 2021https://github.com/nodejs/node/issues/38657#issuecomment-845407352
https://github.com/misos1
misos1https://github.com/misos1
on May 20, 2021https://github.com/nodejs/node/issues/38657#issuecomment-845483773
node/lib/_http_incoming.jshttps://github.com/nodejs/node/blob/d798de1c653efa5ec0015d44f266db6dda197bf4/lib/_http_incoming.js#L184-L189
d798de1https://github.com/nodejs/node/commit/d798de1c653efa5ec0015d44f266db6dda197bf4
targoshttps://github.com/targos
streamIssues and PRs related to Node.js streams.https://github.com/nodejs/node/issues?q=state%3Aopen%20label%3A%22stream%22
on Aug 9, 2021https://github.com/nodejs/node/issues/38657#event-5129788491
https://github.com/apps/github-actions
github-actionshttps://github.com/apps/github-actions
on Jun 27, 2026https://github.com/nodejs/node/issues/38657#issuecomment-4820234895
GitHub Actionshttps://help.github.com/en/actions
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
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 27, 2026https://github.com/nodejs/node/issues/38657#event-27285785953
https://github.com/apps/github-actions
github-actionshttps://github.com/apps/github-actions
on Sep 28, 2026https://github.com/nodejs/node/issues/38657#issuecomment-5861792039
GitHub Actionshttps://help.github.com/en/actions
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
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 Sep 28, 2026https://github.com/nodejs/node/issues/38657#event-31956489739
Sign up for freehttps://github.com/signup?return_to=https://github.com/nodejs/node/issues/38657
Sign in to commenthttps://github.com/login?return_to=https://github.com/nodejs/node/issues/38657
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.