René's URL Explorer Experiment


Title: ECONNRESET while doing http 1.1 keep alive requests and server closes the connections · Issue #47130 · nodejs/node · GitHub

Open Graph Title: ECONNRESET while doing http 1.1 keep alive requests and server closes the connections · Issue #47130 · nodejs/node

X Title: ECONNRESET while doing http 1.1 keep alive requests and server closes the connections · Issue #47130 · nodejs/node

Description: Version v18.15.0 Platform Running this in a Kubernetes cluster inside nodejs:lts container. Details for K8s node "nodeInfo": { "architecture": "amd64", "bootID": "a5847523-d870-4bc0-9f1a-7a4ed9885ca3", "containerRuntimeVersion": "docker:...

Open Graph Description: Version v18.15.0 Platform Running this in a Kubernetes cluster inside nodejs:lts container. Details for K8s node "nodeInfo": { "architecture": "amd64", "bootID": "a5847523-d870-4bc0-9f1a-7a4ed9885c...

X Description: Version v18.15.0 Platform Running this in a Kubernetes cluster inside nodejs:lts container. Details for K8s node "nodeInfo": { "architecture": "amd64", "bootID&qu...

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

X: @github

direct link

Domain: github.com

IPv4 address: 140.82.114.4


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"ECONNRESET while doing http 1.1 keep alive requests and server closes the connections","articleBody":"### Version\r\n\r\nv18.15.0\r\n\r\n### Platform\r\n\r\nRunning this in a Kubernetes cluster inside nodejs:lts container. Details for K8s node \"nodeInfo\": {             \"architecture\": \"amd64\",             \"bootID\": \"a5847523-d870-4bc0-9f1a-7a4ed9885ca3\",             \"containerRuntimeVersion\": \"docker://20.10.12\",             \"kernelVersion\": \"3.10.0-1160.53.1.el7.x86_64\",             \"kubeProxyVersion\": \"v1.21.12\",             \"kubeletVersion\": \"v1.21.12\",             \"machineID\": \"\",             \"operatingSystem\": \"linux\",             \"osImage\": \"Red Hat Enterprise Linux\",             \"systemUUID\": \"290B2642-439A-2099-6F2B-7ED84D7C284B\"         },\r\n\r\n### Subsystem\r\n\r\nhttp or net\r\n\r\n### What steps will reproduce the bug?\r\n\r\nRun non stop http1.1 requests over a keepAlive connection pool using ``node-fetch`` or ``axios`` against any server that closes the connection from its side after 'N' seconds. In my case the server did a 20 second close. There might be multiple requests to the server over the connection but if 20 seconds have elapsed it closes the connection after the the last http response is sent.I have a default nodejs client configuration ( I haven't assigned it more threads or anything).\r\n\r\nWhen configuring the custom http agent on the client side, i supplied ``{keepAlive: true, maxSockets:50}``.\r\n\r\n\r\n### How often does it reproduce? Is there a required condition?\r\n\r\nWhen the there's a lot of requests being sent constantly things are fine, but if there is a slowdown(not many things do, hence lesser requests to go out) - the next request usually ends up getting an ECONNRESET. \r\n\r\nBased on my TCP dump I have, when there's a good load of requests over the connection pool when the server sends a \r\n[FIN, ACK], the client sends a [FIN,ACK] and the server sends an ACK  back and the connection closes successfully \r\n\r\nBut when there is a \"lull\" later and there's not enough requests over the pool, the server sends a [FIN,ACK] for an unused connection in the pool, the nodejs client responds [ACK] and the next request in the queue goes on this socket causing the server to respond with a RESET. (Rightly so - coz the server wanted to close the connection).\r\n\r\nNow I believe the reason for the next request to go on the socket that just got the FIN has probably has to do with connection choosing strategy. I think the default is both these frameworks is lifo, and the ACK (without the FIN) that gets sent makes the connection go to the top of the pool for the next request. \r\n\r\n\r\n\r\n### What is the expected behavior? Why is that the expected behavior?\r\n\r\nA socket closed from the server side (FIN,ACK sent by server) must be removed from the connection pool instead of it being kept in there - Regardless of the fact that a FIN wasn't sent back. And no future requests should go on it.\r\n\r\n### What do you see instead?\r\n\r\nThe connection stays in the pool if the FIN wasn't sent back.  The next request goes on the connection. Sever forcibly closes connection with a RESET\r\n\r\n### Additional information\r\n\r\nI tried a few other frameworks apart from node-fetch and axios (same issue, making me think it's a node core problem) - But I can't use them in my code so not mentioning them . \r\n\r\nWhen I reduced ``maxSockets`` from 50 to 20 the issue happened less frequently. Which is why i think it is related activity on those sockets.  I switch to the ``keepaliveagent`` package that has a SocketTTL feature - it helps, but doesn't solve the problem . Resets still happen (same issue). Seems like this issue was [reported there](https://github.com/node-modules/agentkeepalive/issues/57) and they tried to handle it there (still a problem though). I'm assuming [this issue](https://github.com/MicrosoftDocs/azure-docs/issues/29600) has the same problem I'm facing - they were using ``keepaliveagent`` as well.","author":{"url":"https://github.com/DevasiaThomas","@type":"Person","name":"DevasiaThomas"},"datePublished":"2023-03-17T07:16:41Z","url":"https://github.com/nodejs/node/issues/47130"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:303dc152-96a2-857f-f7cd-2fb7f026c2cd
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id9ADC:6AD3D:AC22AB:DF4A79:6B0638BE
html-safe-noncea1973ad71de93acf4fc72be385538a611ff088e58a9f2350859ba2ecff3c8bd6
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5QURDOjZBRDNEOkFDMjJBQjpERjRBNzk6NkIwNjM4QkUiLCJ2aXNpdG9yX2lkIjoiMzkzMzU3MDA4MzU4MjI2MTQzOCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac7f799f852c613560c204122ff49f64caf1b93c0d8b80d5aed4247957fb2ce5e3
hovercard-subject-tagissue:1628823234
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/47130/issue_layout
twitter:imagehttps://opengraph.githubassets.com/7b75c642ba71153cf7eab7dede576d3fe729ae460238d045e980b77253054b81/nodejs/node/issues/47130
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/7b75c642ba71153cf7eab7dede576d3fe729ae460238d045e980b77253054b81/nodejs/node/issues/47130
og:image:altVersion v18.15.0 Platform Running this in a Kubernetes cluster inside nodejs:lts container. Details for K8s node "nodeInfo": { "architecture": "amd64", "bootID": "a5847523-d870-4bc0-9f1a-7a4ed9885c...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameDevasiaThomas
hostnamegithub.com
expected-hostnamegithub.com
Nonedcf72c457c022486d23c3cbb0dd21aba537a87611ca9ddabd1799cf2eaa9b297
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
release0f38f5735226749ec5e08a8649dce4cb2613d9ad
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/nodejs/node/issues/47130#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fnodejs%2Fnode%2Fissues%2F47130
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%2F47130
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/47130
Reloadhttps://github.com/nodejs/node/issues/47130
Reloadhttps://github.com/nodejs/node/issues/47130
nodejshttps://github.com/nodejs
nodehttps://github.com/nodejs/node
Codehttps://github.com/nodejs/node
Issues629 (629)https://github.com/nodejs/node/issues
Pull requests658 (658)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/insights
https://github.com/nodejs/node
New issuehttps://github.com/login?return_to=https://github.com/nodejs/node/issues/47130
New issuehttps://github.com/login?return_to=https://github.com/nodejs/node/issues/47130
ECONNRESET while doing http 1.1 keep alive requests and server closes the connectionshttps://github.com/nodejs/node/issues/47130#top
httphttps://github.com/nodejs/node/issues?q=state%3Aopen%20label%3A%22http%22
known limitationhttps://github.com/nodejs/node/issues?q=state%3Aopen%20label%3A%22known%20limitation%22
https://github.com/DevasiaThomas
DevasiaThomashttps://github.com/DevasiaThomas
on Mar 17, 2023https://github.com/nodejs/node/issues/47130#issue-1628823234
reported therehttps://github.com/node-modules/agentkeepalive/issues/57
this issuehttps://github.com/MicrosoftDocs/azure-docs/issues/29600
Nexthttps://github.com/nodejs/node/issues/47130?timeline_page=1
bnoordhuishttps://github.com/bnoordhuis
httphttps://github.com/nodejs/node/issues?q=state%3Aopen%20label%3A%22http%22
on Mar 17, 2023https://github.com/nodejs/node/issues/47130#event-8775681731
https://github.com/bnoordhuis
bnoordhuishttps://github.com/bnoordhuis
on Mar 17, 2023https://github.com/nodejs/node/issues/47130#issuecomment-1473397291
https://github.com/DevasiaThomas
DevasiaThomashttps://github.com/DevasiaThomas
on Mar 17, 2023https://github.com/nodejs/node/issues/47130#issuecomment-1473524232
@bnoordhuishttps://github.com/bnoordhuis
https://github.com/bnoordhuis
bnoordhuishttps://github.com/bnoordhuis
on Mar 17, 2023https://github.com/nodejs/node/issues/47130#issuecomment-1474417776
https://github.com/DevasiaThomas
DevasiaThomashttps://github.com/DevasiaThomas
on Mar 18, 2023https://github.com/nodejs/node/issues/47130#issuecomment-1474761750
https://github.com/DevasiaThomas
DevasiaThomashttps://github.com/DevasiaThomas
on Mar 18, 2023https://github.com/nodejs/node/issues/47130#issuecomment-1474961521
@bnoordhuishttps://github.com/bnoordhuis
https://github.com/bnoordhuis
bnoordhuishttps://github.com/bnoordhuis
on Mar 18, 2023https://github.com/nodejs/node/issues/47130#issuecomment-1475025119
https://github.com/DevasiaThomas
DevasiaThomashttps://github.com/DevasiaThomas
on Mar 19, 2023https://github.com/nodejs/node/issues/47130#issuecomment-1475195798
https://user-images.githubusercontent.com/14965729/226168709-f1a15637-2f58-435d-8d17-9f24b2f37ba4.png
https://github.com/ronag
ronaghttps://github.com/ronag
on Mar 19, 2023https://github.com/nodejs/node/issues/47130#issuecomment-1475237365
https://github.com/DevasiaThomas
DevasiaThomashttps://github.com/DevasiaThomas
on Mar 19, 2023https://github.com/nodejs/node/issues/47130#issuecomment-1475253622
https://github.com/ronag
ronaghttps://github.com/ronag
on Mar 19, 2023https://github.com/nodejs/node/issues/47130#issuecomment-1475281961
https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Keep-Alivehttps://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Keep-Alive
https://github.com/ronag
ronaghttps://github.com/ronag
on Mar 19, 2023https://github.com/nodejs/node/issues/47130#issuecomment-1475282248
https://github.com/DevasiaThomas
DevasiaThomashttps://github.com/DevasiaThomas
on Mar 19, 2023https://github.com/nodejs/node/issues/47130#issuecomment-1475283148
@ronaghttps://github.com/ronag
https://github.com/ronag
ronaghttps://github.com/ronag
on Mar 19, 2023https://github.com/nodejs/node/issues/47130#issuecomment-1475333499
@mcollinahttps://github.com/mcollina
https://github.com/ywave620
ywave620https://github.com/ywave620
on Mar 20, 2023https://github.com/nodejs/node/issues/47130#issuecomment-1475537993
@DevasiaThomashttps://github.com/DevasiaThomas
@ronaghttps://github.com/ronag
@bnoordhuishttps://github.com/bnoordhuis
https://github.com/dhedey
dhedeyhttps://github.com/dhedey
on Jul 23, 2024https://github.com/nodejs/node/issues/47130#issuecomment-2245282979
@ronaghttps://github.com/ronag
retry handlerhttps://github.com/nodejs/undici/pull/2281/files
section 8.1.4 of the http 1.1 spechttps://datatracker.ietf.org/doc/html/rfc2616#section-8.1.4
section 9.1.2https://datatracker.ietf.org/doc/html/rfc2616#section-9.1.2
I previously put forwardhttps://github.com/nodejs/node/issues/47130#issuecomment-1902891104
https://github.com/ronag
ronaghttps://github.com/ronag
on Jul 23, 2024https://github.com/nodejs/node/issues/47130#issuecomment-2246018837
@ronaghttps://github.com/ronag
retry handlerhttps://github.com/nodejs/undici/pull/2281/files
section 8.1.4 of the http 1.1 spechttps://datatracker.ietf.org/doc/html/rfc2616#section-8.1.4
section 9.1.2https://datatracker.ietf.org/doc/html/rfc2616#section-9.1.2
I previously put forwardhttps://github.com/nodejs/node/issues/47130#issuecomment-1902891104
https://github.com/dhedey
dhedeyhttps://github.com/dhedey
on Jul 23, 2024https://github.com/nodejs/node/issues/47130#issuecomment-2246562912
@ronaghttps://github.com/ronag
https://github.com/ronag
ronaghttps://github.com/ronag
on Jul 24, 2024https://github.com/nodejs/node/issues/47130#issuecomment-2247127500
@mcollinahttps://github.com/mcollina
https://github.com/rubengmurray
rubengmurrayhttps://github.com/rubengmurray
on Jul 24, 2024https://github.com/nodejs/node/issues/47130#issuecomment-2247201492
https://github.com/rubengmurray
rubengmurrayhttps://github.com/rubengmurray
on Jul 24, 2024https://github.com/nodejs/node/issues/47130#issuecomment-2248148669
nock/nock#2183https://github.com/nock/nock/issues/2183
https://github.com/adijesori
adijesorihttps://github.com/adijesori
on Jul 24, 2024https://github.com/nodejs/node/issues/47130#issuecomment-2248161362
MattiasOllahttps://github.com/MattiasOlla
on Jul 29, 2024https://github.com/nodejs/node/issues/47130#event-13678999083
Don't enable HTTP keepalive by defaulthttps://github.com/BonnierNews/lu-common/commit/ae75f396c6d84a0f40ea0cb0a9e01ee21b476181
ae75f39https://github.com/BonnierNews/lu-common/commit/ae75f396c6d84a0f40ea0cb0a9e01ee21b476181
https://github.com/ziimakc
ziimakchttps://github.com/ziimakc
on Aug 4, 2024https://github.com/nodejs/node/issues/47130#issuecomment-2267641766
https://github.com/abrie-stubber
abrie-stubberhttps://github.com/abrie-stubber
on Oct 25, 2024https://github.com/nodejs/node/issues/47130#issuecomment-2437254542
https://github.com/ronag
ronaghttps://github.com/ronag
on Oct 25, 2024https://github.com/nodejs/node/issues/47130#issuecomment-2437274561
@mcollinahttps://github.com/mcollina
https://github.com/dreaganluna
dreaganlunahttps://github.com/dreaganluna
on Nov 6, 2024https://github.com/nodejs/node/issues/47130#issuecomment-2459717544
https://github.com/adijesori
adijesorihttps://github.com/adijesori
on Aug 26, 2025https://github.com/nodejs/node/issues/47130#issuecomment-3225064364
https://github.com/Lomilar
Lomilarhttps://github.com/Lomilar
on Aug 27, 2025https://github.com/nodejs/node/issues/47130#issuecomment-3228717246
Kaesualhttps://github.com/Kaesual
on Aug 4, 2026https://github.com/nodejs/node/issues/47130#event-28980288598
chore(deps): refresh the backend lockfile within existing ranges (wav…https://github.com/Common-Ground-DAO/commonground/commit/6ceac902b0832839b19f435f6ef7255e3587fdbd
6ceac90https://github.com/Common-Ground-DAO/commonground/commit/6ceac902b0832839b19f435f6ef7255e3587fdbd
Sign up for freehttps://github.com/signup?return_to=https://github.com/nodejs/node/issues/47130
Sign in to commenthttps://github.com/login?return_to=https://github.com/nodejs/node/issues/47130
httphttps://github.com/nodejs/node/issues?q=state%3Aopen%20label%3A%22http%22
known limitationhttps://github.com/nodejs/node/issues?q=state%3Aopen%20label%3A%22known%20limitation%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

Response headers:
Servergithub.com
Content-Typetext/html; charset=utf-8
Cache-Controlmax-age=0, private, must-revalidate

Viewport: width=device-width


URLs of crawlers that visited me.