Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
net: increase network family autoselection timeout to 500ms
The current 250ms timeout is too short for high-latency network
environments, causing connection failures in IPv4-only networks when
connecting to dual-stack hosts. This increases the timeout to 500ms
to better handle satellite, cellular, and geographically distant
connections.

The timeout should be reconsidered when parallel connections are
implemented as per RFC 8305.

Refs: #54359
Refs: #48145
  • Loading branch information
hvanness authored and rvagg committed Oct 21, 2025
commit 5ebe61905037d060ec21b10c71a6a0b83456113a
2 changes: 1 addition & 1 deletion doc/api/net.md
Original file line number Diff line number Diff line change
Expand Up @@ -1905,7 +1905,7 @@ added:
-->

Gets the current default value of the `autoSelectFamilyAttemptTimeout` option of [`socket.connect(options)`][].
The initial default value is `250` or the value specified via the command line
The initial default value is `500` or the value specified via the command line
option `--network-family-autoselection-attempt-timeout`.

* Returns: {number} The current default value of the `autoSelectFamilyAttemptTimeout` option.
Expand Down
2 changes: 1 addition & 1 deletion src/node_options.h
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ class EnvironmentOptions : public Options {
int64_t heap_snapshot_near_heap_limit = 0;
std::string heap_snapshot_signal;
bool network_family_autoselection = true;
uint64_t network_family_autoselection_attempt_timeout = 250;
uint64_t network_family_autoselection_attempt_timeout = 500;
uint64_t max_http_header_size = 16 * 1024;
bool deprecation = true;
bool force_async_hooks_checks = true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ const { platformTimeout } = require('../common');
const assert = require('assert');
const { getDefaultAutoSelectFamilyAttemptTimeout } = require('net');

assert.strictEqual(getDefaultAutoSelectFamilyAttemptTimeout(), platformTimeout(2500));
assert.strictEqual(getDefaultAutoSelectFamilyAttemptTimeout(), platformTimeout(5000));
Loading