Repository navigation
Conversation
Collaborator
|
Review requested:
|
Contributor
|
Welcome to Node.js, and thank you for your first contribution! Before review, please take a moment to read:
Please make sure every commit is signed off. For a first pull request, GitHub Actions require collaborator approval and Jenkins CI must be started by a collaborator or triager, so an initial wait is normal. |
With family autoselection, when the last address failed while earlier attempts were still pending, the pending attempts were given one more `autoSelectFamilyAttemptTimeout` and then failed with `ETIMEDOUT`. This made the outcome depend on the order of the addresses. A healthy host that takes longer than the attempt timeout to complete the TCP handshake connects when it is the only address or the last one, but fails when it is followed by an address that fails right away, such as an IPv6 address on a host without IPv6 connectivity. Leave the pending attempts to complete instead, as is already done when the last attempt is the one that is pending. The attempt timeout only staggers the attempts. The connection fails once all attempts failed. Signed-off-by: umar418 <farooqumer694@gmail.com>
umar418
force-pushed
the
net-autoselect-keep-pending-attempts
branch
from
December 1, 2026 00:15
9ac9a07 to
39b3cec
Compare
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
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
With family autoselection (
autoSelectFamily), when the last address failed while earlier attempts were still pending, the pending attempts were given one moreautoSelectFamilyAttemptTimeoutand then failed withETIMEDOUT.This made the outcome depend on the order of the addresses. A healthy host that takes longer than the attempt timeout to complete the TCP handshake connects when it is the only address or the last one, but fails when it is followed by an address that fails right away, such as an IPv6 address on a host without IPv6 connectivity.
This change leaves the pending attempts to complete instead, as is already done when the last attempt is the one that is pending. The attempt timeout only staggers the attempts. The connection fails once all attempts have failed.
Changes
lib/net.js: remove the final timeout that was armed when the last attempt failed with others still pending.doc/api/net.md: update theautoSelectFamilydescription to match.test/parallel/test-net-autoselectfamily-parallel-last-failure.js: new test covering a slow first address followed by an address that fails immediately. It replacestest-net-autoselectfamily-parallel-final-timeout.js, which asserted the old behavior.Testing
Ran
tools/test.pyonparallel/test-net-autoselectfamily*,parallel/test-net-connect*and thehttp,httpsandtlsautoselectfamily tests (37 tests, all passing), and ESLint on the changed files. The full test suite was not run locally.🤖 Generated with Claude Code