node
node copied to clipboard
net: improve network family autoselection handle handling
This PR fixes network family autoselections in three area:
- Moves handle swapping before trying a new connection, as suggested in https://github.com/npm/cli/issues/6409#issuecomment-1577019656
- Avoids spawning two different connection attempts, which could happen if a
TLSSocket
with a manually set backingSocket
was used. See: https://github.com/KararTY/dank-twitch-irc/issues/13#issuecomment-1591251579 - Correctly handles
AbortSignal
when using network family auto selection.
Fixes: https://github.com/npm/cli/issues/6409 Fixes: https://github.com/KararTY/dank-twitch-irc/issues/13 Fixes: #47644
CC: @tniessen @silverwind
CI: https://ci.nodejs.org/job/node-test-pull-request/52262/
CI: https://ci.nodejs.org/job/node-test-pull-request/52263/
CI: https://ci.nodejs.org/job/node-test-pull-request/52340/
I'll check the failing test locally this evening and then I'll update and finally merge this.
CI: https://ci.nodejs.org/job/node-test-pull-request/52487/
CI: https://ci.nodejs.org/job/node-test-pull-request/52499/
Landed in fddd3ffa5947417ee9e65f1fc1e9e091cc52f8c3
This commit does not land cleanly on v18.x-staging
and will need manual backport in case we want it in v18.