René's URL Explorer Experiment


Title: Update http module to return "408 - Request timeout"- when closing idle TCP connections. · Issue #38890 · nodejs/node · GitHub

Open Graph Title: Update http module to return "408 - Request timeout"- when closing idle TCP connections. · Issue #38890 · nodejs/node

X Title: Update http module to return "408 - Request timeout"- when closing idle TCP connections. · Issue #38890 · nodejs/node

Description: Is your feature request related to a problem? YES Currently, http implementation results in random HTTP errors, as a result of race conditions when closing idle connections. Node closes idle TCP connections after 5 seconds (configurable ...

Open Graph Description: Is your feature request related to a problem? YES Currently, http implementation results in random HTTP errors, as a result of race conditions when closing idle connections. Node closes idle TCP co...

X Description: Is your feature request related to a problem? YES Currently, http implementation results in random HTTP errors, as a result of race conditions when closing idle connections. Node closes idle TCP co...

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

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Update http module to return \"408 - Request timeout\"- when closing idle TCP connections.","articleBody":"**Is your feature request related to a problem? YES**\r\n\r\nCurrently, http implementation results in random HTTP errors, as a result of race conditions when closing idle connections.\r\n\r\nNode closes idle TCP connections after 5 seconds (configurable using `server.keepAliveTimeout`),\r\nresulting in a race conditions described at: [https://nodejs.org/api/http.html#http_request_reusedsocket]()\r\n\r\nThis documentation proposes request might be retried when receiving a `ECONNRESET` error, and that's what\r\nbrowsers do. However, this is not applicable when working with API Gateways, which can't close a downstream\r\nconnection (shared by multiple services) when an upstream connection is closed.\r\nInstead, Gateways return a 503 error code when an upstream connection is closed, resulting in a HTTP error.\r\nAdditional info [here](https://medium.com/@phylake/why-idle-timeouts-matter-1b3f7d4469fe).\r\n\r\nThe solution would be to configure `server.keepAliveTimeout` to be larger than the client. But Chrome keeps idle connections open for 5 to 6 minutes (according to [link](https://bugs.chromium.org/p/chromium/issues/detail?id=27400), up to 10 minutes). Using such a long timeout in the cloud  might not be a good idea.\r\n\r\n**Proposed solution**\r\n[RFC7231#6.5.7](https://datatracker.ietf.org/doc/html/rfc7231#section-6.5.7) and [Mozilla](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/408) specify that servers MAY/SHOULD send a `408 – Request Timeout` response when closing idle connections, _even without a previous request from the server_. This would make any further request (if any) to receive a 408 error and would be automatically retried by the browser.\r\n\r\nNotice that, when using CORS, 408 response MUST include CORS headers (`Access-Control-Allow-Origin: *`).\r\n\r\nCurrently, there's no simple way to update http module, to return a 408 error when closing idle connections.\r\n\r\nI propose updating http module, to allow handling the idle-connection close event. Eg:\r\n```\r\nserver.on('idle', socket => {\r\n  socket.write('408 - Request timeout\\r\\nConnection: close\\r\\nAccess-Control-Allow-Origin: *\\r\\n\\r\\n');\r\n  socket.close();\r\n});\r\n```\r\n\r\n**Alternative solution**\r\nThis feature could also be an option, when creating the HTTP server. Eg:\r\n```\r\nhttp.createServer({ reply408WhenClosingIdleConnections: true }, handler);\r\n```\r\n","author":{"url":"https://github.com/gpra","@type":"Person","name":"gpra"},"datePublished":"2021-06-01T15:08:40Z","url":"https://github.com/nodejs/node/issues/38890"}

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:7e347fa4-68eb-4df7-c0bb-dd1d99bfd039
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idB0BC:2F339D:C1B142:1022A2C:6AED3C65
html-safe-nonce74e07f19fac2a1f4dd05f2f22d05e23d7ad752e94abe45f55f1c424fce1cf1e2
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCMEJDOjJGMzM5RDpDMUIxNDI6MTAyMkEyQzo2QUVEM0M2NSIsInZpc2l0b3JfaWQiOiIxMjU2NDU2NTI0OTA5MDY3MzY1IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmac717590553b4543539b617d36e19d69f078f6b40fc8170670859dc5d8fe4f5297
hovercard-subject-tagissue:908396163
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/38890/issue_layout
twitter:imagehttps://opengraph.githubassets.com/dd14dade1752887ac3018dfd168d48521bf1cf6ee3b4a71aff42c8feef1203a6/nodejs/node/issues/38890
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/dd14dade1752887ac3018dfd168d48521bf1cf6ee3b4a71aff42c8feef1203a6/nodejs/node/issues/38890
og:image:altIs your feature request related to a problem? YES Currently, http implementation results in random HTTP errors, as a result of race conditions when closing idle connections. Node closes idle TCP co...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamegpra
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/38890#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fnodejs%2Fnode%2Fissues%2F38890
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%2F38890
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/38890
Reloadhttps://github.com/nodejs/node/issues/38890
Reloadhttps://github.com/nodejs/node/issues/38890
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/38890
New issuehttps://github.com/login?return_to=https://github.com/nodejs/node/issues/38890
Update http module to return "408 - Request timeout"- when closing idle TCP connections.https://github.com/nodejs/node/issues/38890#top
feature requestIssues requesting new Node.js features.https://github.com/nodejs/node/issues?q=state%3Aopen%20label%3A%22feature%20request%22
httpIssues and PRs related to the http subsystem.https://github.com/nodejs/node/issues?q=state%3Aopen%20label%3A%22http%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
https://github.com/gpra
gprahttps://github.com/gpra
on Jun 1, 2021https://github.com/nodejs/node/issues/38890#issue-908396163
https://nodejs.org/api/http.html#http_request_reusedsockethttps://github.com/nodejs/node/issues/38890
herehttps://medium.com/@phylake/why-idle-timeouts-matter-1b3f7d4469fe
linkhttps://bugs.chromium.org/p/chromium/issues/detail?id=27400
RFC7231#6.5.7https://datatracker.ietf.org/doc/html/rfc7231#section-6.5.7
Mozillahttps://developer.mozilla.org/en-US/docs/Web/HTTP/Status/408
Ayase-252https://github.com/Ayase-252
feature requestIssues requesting new Node.js features.https://github.com/nodejs/node/issues?q=state%3Aopen%20label%3A%22feature%20request%22
httpIssues and PRs related to the http subsystem.https://github.com/nodejs/node/issues?q=state%3Aopen%20label%3A%22http%22
on Jun 2, 2021https://github.com/nodejs/node/issues/38890#event-4828918449
https://github.com/XadillaX
XadillaXhttps://github.com/XadillaX
on Jun 3, 2021https://github.com/nodejs/node/issues/38890#issuecomment-853583403
https://github.com/gpra
gprahttps://github.com/gpra
on Jun 4, 2021https://github.com/nodejs/node/issues/38890#issuecomment-855040592
https://github.com/zxh326
zxh326https://github.com/zxh326
on Oct 27, 2021https://github.com/nodejs/node/issues/38890#issuecomment-952704800
targoshttps://github.com/targos
Node.js feature requestshttps://github.com/orgs/nodejs/projects/4
on Apr 4, 2022https://github.com/nodejs/node/issues/38890#event-15230243267
targoshttps://github.com/targos
Node.js feature requestshttps://github.com/orgs/nodejs/projects/4
on Apr 4, 2022https://github.com/nodejs/node/issues/38890
https://github.com/apps/github-actions
github-actionshttps://github.com/apps/github-actions
on Apr 26, 2022https://github.com/nodejs/node/issues/38890#issuecomment-1109202403
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 Apr 26, 2022https://github.com/nodejs/node/issues/38890#event-6494641502
https://github.com/apps/github-actions
github-actionshttps://github.com/apps/github-actions
on May 26, 2022https://github.com/nodejs/node/issues/38890#issuecomment-1138046360
feature request management documenthttps://github.com/nodejs/node/blob/HEAD/doc/contributing/feature-request-management.md
github-actionshttps://github.com/apps/github-actions
completedhttps://github.com/nodejs/node/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
on May 26, 2022https://github.com/nodejs/node/issues/38890#event-6682267801
targoshttps://github.com/targos
Node.js feature requestshttps://github.com/orgs/nodejs/projects/4
on Apr 4, 2023https://github.com/nodejs/node/issues/38890
avivkellerhttps://github.com/avivkeller
Node.js feature requestshttps://github.com/orgs/nodejs/projects/4
on Jun 26, 2024https://github.com/nodejs/node/issues/38890
Sign up for freehttps://github.com/signup?return_to=https://github.com/nodejs/node/issues/38890
Sign in to commenthttps://github.com/login?return_to=https://github.com/nodejs/node/issues/38890
feature requestIssues requesting new Node.js features.https://github.com/nodejs/node/issues?q=state%3Aopen%20label%3A%22feature%20request%22
httpIssues and PRs related to the http subsystem.https://github.com/nodejs/node/issues?q=state%3Aopen%20label%3A%22http%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
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.