René's URL Explorer Experiment


Title: Calling `socket.destroy()` causes unhandled error in v12.16.3 · Issue #33434 · nodejs/node · GitHub

Open Graph Title: Calling `socket.destroy()` causes unhandled error in v12.16.3 · Issue #33434 · nodejs/node

X Title: Calling `socket.destroy()` causes unhandled error in v12.16.3 · Issue #33434 · nodejs/node

Description: Version: v12.16.3 Platform: Linux 73659abd8e3f 4.19.76-linuxkit #1 SMP Thu Oct 17 19:31:58 UTC 2019 x86_64 GNU/Linux Subsystem: _http_agent, _http_client What steps will reproduce the bug? const http = require('http') const { host = '127...

Open Graph Description: Version: v12.16.3 Platform: Linux 73659abd8e3f 4.19.76-linuxkit #1 SMP Thu Oct 17 19:31:58 UTC 2019 x86_64 GNU/Linux Subsystem: _http_agent, _http_client What steps will reproduce the bug? const ht...

X Description: Version: v12.16.3 Platform: Linux 73659abd8e3f 4.19.76-linuxkit #1 SMP Thu Oct 17 19:31:58 UTC 2019 x86_64 GNU/Linux Subsystem: _http_agent, _http_client What steps will reproduce the bug? const ht...

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

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Calling `socket.destroy()` causes unhandled error in v12.16.3","articleBody":"* **Version**: v12.16.3\r\n* **Platform**: Linux 73659abd8e3f 4.19.76-linuxkit #1 SMP Thu Oct 17 19:31:58 UTC 2019 x86_64 GNU/Linux\r\n* **Subsystem**: _http_agent, _http_client\r\n\r\n### What steps will reproduce the bug?\r\n\r\n```javascript\r\nconst http = require('http')\r\nconst { host = '127.0.0.1', port = '8080' } = process.env\r\n\r\nhttp\r\n  .createServer((_, res) => {\r\n    res.end('data')\r\n  })\r\n  .listen(port, () => {\r\n    const request = http\r\n      .request({\r\n        host,\r\n        port,\r\n        headers: { 'Connection': 'keep-alive' }\r\n      }, response => {\r\n        response\r\n          .on('data', () => {})\r\n          .on('end', () => {})\r\n      })\r\n      .end()\r\n    setTimeout(() => {\r\n      request.socket.destroy('Some error') // this line causes the error\r\n    }, 500)\r\n  })\r\n\r\n```\r\n### How often does it reproduce? Is there a required condition?\r\n\r\nIt is reproduced 100% when running the code snippet above with node v12.16.3.\r\n\r\n### What is the expected behavior?\r\n\r\nThe behavior is inconsistent between node v12.16.2 and v12.16.3. I suppose, it would be ok in a next major-version. But, as it is a patch-version release, the error should not be thrown.\r\n\r\n### What do you see instead?\r\n\r\n```\r\nevents.js:301\r\n    throw err; // Unhandled 'error' event\r\n    ^\r\n\r\nError [ERR_UNHANDLED_ERROR]: Unhandled error. ('Some error')\r\n    at Socket.emit (events.js:299:17)\r\n    at emitErrorNT (internal/streams/destroy.js:92:8)\r\n    at processTicksAndRejections (internal/process/task_queues.js:84:21) {\r\n  code: 'ERR_UNHANDLED_ERROR',\r\n  context: 'Some error'\r\n}\r\n```\r\n\r\n### Additional information\r\n\r\nLooks like the problem is caused by this commit https://github.com/nodejs/node/commit/225ddd5f425313908cf53d5d29fe746612d31e4c, it's exactly what @ronag described [here](https://github.com/nodejs/node/commit/225ddd5f425313908cf53d5d29fe746612d31e4c#diff-e3bc37430eb078ccbafe3aa3b570c91aR619). The socket has no `'error'` event handler, so [unhandled error is thrown](https://github.com/nodejs/node/blob/225ddd5f425313908cf53d5d29fe746612d31e4c/lib/events.js#L287), which can only be caught with `process.on`. Otherwise the process crashes.\r\n\r\nI'm not sure if it's a heavy breaking change or the commit I mentioned should be reverted, as it can easily be fixed by adding an `'error'` event handler to a socket. But it definitely caused me an hour or two of happy debug.\r\n\r\nPlease let me know if I can help with those todos in `_http_client.js`.","author":{"url":"https://github.com/pkozemirov","@type":"Person","name":"pkozemirov"},"datePublished":"2020-05-16T12:29:03Z","url":"https://github.com/nodejs/node/issues/33434"}

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:9d23c35b-24dc-7fab-855e-78d3ed55099f
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id9EBA:137C1B:53B7AE:6CF325:6AED2814
html-safe-nonceaa316b31a93292d697920426396fff3599ed510a90b8011949f306715344277f
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5RUJBOjEzN0MxQjo1M0I3QUU6NkNGMzI1OjZBRUQyODE0IiwidmlzaXRvcl9pZCI6IjIwNjYwNzk0ODEwNzA0MzAyMjgiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac64d69f8b38512ee03ae6fccf90564d8524a539f131e7ee03c4401cb0e1aa1268
hovercard-subject-tagissue:619462407
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/33434/issue_layout
twitter:imagehttps://opengraph.githubassets.com/67031d45368bbd61728c8190702dd90a391502df9aa4e63469f28347e98891e6/nodejs/node/issues/33434
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/67031d45368bbd61728c8190702dd90a391502df9aa4e63469f28347e98891e6/nodejs/node/issues/33434
og:image:altVersion: v12.16.3 Platform: Linux 73659abd8e3f 4.19.76-linuxkit #1 SMP Thu Oct 17 19:31:58 UTC 2019 x86_64 GNU/Linux Subsystem: _http_agent, _http_client What steps will reproduce the bug? const ht...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamepkozemirov
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/33434#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fnodejs%2Fnode%2Fissues%2F33434
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%2F33434
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/33434
Reloadhttps://github.com/nodejs/node/issues/33434
Reloadhttps://github.com/nodejs/node/issues/33434
nodejshttps://github.com/nodejs
nodehttps://github.com/nodejs/node
Codehttps://github.com/nodejs/node
Issues657 (657)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/33434
New issuehttps://github.com/login?return_to=https://github.com/nodejs/node/issues/33434
Calling socket.destroy() causes unhandled error in v12.16.3https://github.com/nodejs/node/issues/33434#top
httpIssues and PRs related to the http subsystem.https://github.com/nodejs/node/issues?q=state%3Aopen%20label%3A%22http%22
https://github.com/pkozemirov
pkozemirovhttps://github.com/pkozemirov
on May 16, 2020https://github.com/nodejs/node/issues/33434#issue-619462407
deps: update openssl to 1.0.1j #1https://github.com/nodejs/node/pull/1
225ddd5https://github.com/nodejs/node/commit/225ddd5f425313908cf53d5d29fe746612d31e4c
@ronaghttps://github.com/ronag
herehttps://github.com/nodejs/node/commit/225ddd5f425313908cf53d5d29fe746612d31e4c#diff-e3bc37430eb078ccbafe3aa3b570c91aR619
unhandled error is thrownhttps://github.com/nodejs/node/blob/225ddd5f425313908cf53d5d29fe746612d31e4c/lib/events.js#L287
https://github.com/ronag
ronaghttps://github.com/ronag
on May 18, 2020https://github.com/nodejs/node/issues/33434#issuecomment-630386092
https://github.com/vostrik
vostrikhttps://github.com/vostrik
on May 27, 2020https://github.com/nodejs/node/issues/33434#issuecomment-634533373
@ronaghttps://github.com/ronag
@pkozemirovhttps://github.com/pkozemirov
https://github.com/ronag
ronaghttps://github.com/ronag
on May 27, 2020https://github.com/nodejs/node/issues/33434#issuecomment-634533892
@vostrikhttps://github.com/vostrik
https://github.com/Baxtishodd
Baxtishoddhttps://github.com/Baxtishodd
on May 27, 2020https://github.com/nodejs/node/issues/33434#issuecomment-634569009
https://github.com/ronag
ronaghttps://github.com/ronag
on May 27, 2020https://github.com/nodejs/node/issues/33434#issuecomment-634594591
targoshttps://github.com/targos
httpIssues and PRs related to the http subsystem.https://github.com/nodejs/node/issues?q=state%3Aopen%20label%3A%22http%22
v12.xhttps://github.com/nodejs/node/issues?q=state%3Aopen%20label%3A%22v12.x%22
on Dec 27, 2020https://github.com/nodejs/node/issues/33434#event-4150227563
https://github.com/targos
targoshttps://github.com/targos
on Dec 27, 2020https://github.com/nodejs/node/issues/33434#issuecomment-751458274
https://github.com/brucewar
brucewarhttps://github.com/brucewar
on Apr 6, 2022https://github.com/nodejs/node/issues/33434#issuecomment-1090224937
https://github.com/targos
targoshttps://github.com/targos
on Apr 8, 2022https://github.com/nodejs/node/issues/33434#issuecomment-1092593268
targoshttps://github.com/targos
completedhttps://github.com/nodejs/node/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
on Apr 8, 2022https://github.com/nodejs/node/issues/33434#event-6394593301
Sign up for freehttps://github.com/signup?return_to=https://github.com/nodejs/node/issues/33434
Sign in to commenthttps://github.com/login?return_to=https://github.com/nodejs/node/issues/33434
httpIssues and PRs related to the http subsystem.https://github.com/nodejs/node/issues?q=state%3Aopen%20label%3A%22http%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.