FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Temporarily increase network_family_autoselection_attempt_timeout to 500ms by hvanness · Pull Request #56738 · nodejs/node · GitHub

/ node Public

Temporarily increase network_family_autoselection_attempt_timeout to 500ms - #56738

Open
hvanness wants to merge 1 commit into
nodejs:mainfrom
hvanness:network_family_autoselection_attempt_timeout_500
Open

Temporarily increase network_family_autoselection_attempt_timeout to 500ms#56738
hvanness wants to merge 1 commit into
nodejs:mainfrom
hvanness:network_family_autoselection_attempt_timeout_500

Conversation

Copy link
Copy Markdown

The timeout currently closes the connection instead of supporting parallel connections. This should be reset to 250ms if parallel connections are implemented as per RFC 8305.

This PR was initiated in this discussion, where @ShogunPanda suggested 300ms - 500ms timeout.

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/net

nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. needs-ci PRs that need a full CI run. labels Jan 24, 2025

Copy link
Copy Markdown
Author

Please add notable-change label.
These docs will need to be updated

mcollina requested a review from ShogunPanda January 24, 2025 09:13

Copy link
Copy Markdown
Member

Can you articulate why we should be doubling this? The other discussion is very long.

codecov Bot commented Jan 24, 2025
edited
Loading

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.21%. Comparing base (50d405a) to head (92e1aaa).
⚠️ Report is 3222 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #56738      +/-   ##
==========================================
- Coverage   89.22%   89.21%   -0.02%     
==========================================
  Files         663      663              
  Lines      191974   192012      +38     
  Branches    36926    36933       +7     
==========================================
+ Hits       171286   171294       +8     
- Misses      13561    13575      +14     
- Partials     7127     7143      +16     
Files with missing lines Coverage Δ
src/node_options.h 98.33% <100.00%> (+<0.01%) ⬆️

... and 33 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Copy Markdown
Contributor

@hvanness Can you please update failing tests? Once you do that, this PR will LGTM.

hvanness force-pushed the network_family_autoselection_attempt_timeout_500 branch from 9de2507 to f527634 Compare January 28, 2025 01:30

Copy link
Copy Markdown
Author

Can you articulate why we should be doubling this? The other discussion is very long.

This is a socket connection hard timeout, which should eventually be removed from the implementation.

For now, increasing it to 500ms resolves the majority of breaking cases:
250ms is about how long it takes to connect from Australia to US East.

PS. I maintain that parallel connections are equally safe as serial. If it is possible to stop a connection to make it serial, then it must be possible to stop all connections when one parallel connection is established.

Copy link
Copy Markdown
Contributor

PS. I maintain that parallel connections are equally safe as serial. If it is possible to stop a connection to make it serial, then it must be possible to stop all connections when one parallel connection is established.

Unfortunately that's not the case. Sockets are created at C++ layer and linked to JS objects. The code is structured to have one C++ socket per JS socket and having multiple would impact significant refactoring in the code, especially w.r.t. callbacks established in many other places of the code (like TLS).

hvanness force-pushed the network_family_autoselection_attempt_timeout_500 branch from b82a398 to e26919c Compare January 30, 2025 22:43
…500ms

The timeout currently closes the connection instead of supporting
parallel connections. This should be reset to 250ms if parallel
connections are implemented as per RFC 8305.
hvanness force-pushed the network_family_autoselection_attempt_timeout_500 branch from e26919c to 92e1aaa Compare January 30, 2025 22:55

Copy link
Copy Markdown

Temporarily?
Just let it stay at 500ms, it's probably not even enough considering the actual latency the services experience.

Copy link
Copy Markdown
Contributor

My problem with this PR is that while increasing the timeout is semver-minor, decreasing would be semver-major (unless we opt to revert the change, which is not always a good idea).

I'll bring this into the next TSC to get a line of action.

ShogunPanda added the tsc-agenda Issues and PRs to discuss during the meetings of the TSC. label Apr 8, 2025

RafaelGSS left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

LGTM

RafaelGSS removed the tsc-agenda Issues and PRs to discuss during the meetings of the TSC. label Apr 9, 2025
richardlau added the baking-for-lts PRs that need to wait before landing in a LTS release. label Apr 9, 2025

BridgeAR left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

The increase itself is LGTM. Thanks for the PR! We just need to document the change in the changes section, so that users know about it.

Similar to e.g., https://github.com/nodejs/node/pull/56738/files#diff-d76469e9e7f555294a7a5488c5c8fc4ef8ce5aea448cc26a1322d1ab693e09caL1713-L1724

Please also change the commit message to adhere to our commit message guidelines as outlined in the pull request contributing document :)
It should actually not be a temporary increase. We likely stick with this until we find a completely different solution.

I didn't check if anything else has to be changed here.

Copy link
Copy Markdown
Member

Applied the baking-for-lts labelled as discussed in today's TSC meeting. This label signifies that this should be considered for LTS versions of Node.js, but not immediately backported because we would like to see if any issues arise when this is included on a current release first.

Copy link
Copy Markdown
Contributor

@hvanness If you fix the commit we will be happy to land this.

Copy link
Copy Markdown

@hvanness did you plan to make the requested change to this commit so they could land it?

mcollina left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

lgtm

mcollina commented Jul 2, 2025

Copy link
Copy Markdown
Member

Can you adjust the first commit to follow our guidelines?

Copy link
Copy Markdown
Contributor

This pull request has been marked as stale due to 210 days of inactivity.
It will be automatically closed in 30 days if no further activity occurs. If this is still relevant, please leave a comment or update it to keep it open.

github-actions Bot added the stale label Apr 22, 2026
github-actions Bot removed the stale label Apr 23, 2026

Copy link
Copy Markdown

@hvanness are there any intentions to continue this?

I'm facing similar issues and would love to see this merged, thanks!

mrivas00 added a commit to undp/carbon-footprint-program that referenced this pull request Jun 12, 2026
…yeballs 250ms budget) (#381)

Node >=20 enables autoSelectFamily with a 250ms per-address connect
budget. On links whose TCP connect to the identity provider exceeds it
(VPNs, deployments far from Microsoft endpoints), every outbound
connection attempt is aborted: jwks-rsa cannot download signing keys and
the API rejects ALL valid tokens with an empty 401 — intermittently,
since real-world latency fluctuates around the threshold. The same
budget governs the http/https agents used by the storage SDKs.

Known upstream issue (nodejs/node#54359). Node 25.2 raised the default
to 500ms (nodejs/node#60334), still tight for high-RTT links and not
backported to 24 LTS, so set the 2500ms value originally proposed
upstream (nodejs/node#56738) at bootstrap. Connections that finish
faster are unaffected; only failover to dead addresses gets slower.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

baking-for-lts PRs that need to wait before landing in a LTS release. c++ Issues and PRs that require attention from people who are familiar with C++. needs-ci PRs that need a full CI run.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants


Back | FazBrowse Home | New Git URL