Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Temporarily increase network_family_autoselection_attempt_timeout to 500ms #56738

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

hvanness
Copy link

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.

@nodejs-github-bot
Copy link
Collaborator

Review requested:

  • @nodejs/net

@nodejs-github-bot 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
@hvanness
Copy link
Author

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

@mcollina mcollina requested a review from ShogunPanda January 24, 2025 09:13
@mcollina
Copy link
Member

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

Copy link

codecov bot commented Jan 24, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.21%. Comparing base (50d405a) to head (92e1aaa).
Report is 29 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

@ShogunPanda
Copy link
Contributor

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

@hvanness hvanness force-pushed the network_family_autoselection_attempt_timeout_500 branch from 9de2507 to f527634 Compare January 28, 2025 01:30
@hvanness
Copy link
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.

@ShogunPanda
Copy link
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 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 hvanness force-pushed the network_family_autoselection_attempt_timeout_500 branch from e26919c to 92e1aaa Compare January 30, 2025 22:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.

4 participants