Adopting dns result order changes with Node v18 update #189805
Labels
debt
Code quality issues
electron-25-update
engineering
VS Code - Build / issue tracking / etc.
nodejs
NodeJS support issues
Milestone
The change comes in via Electron 25 update #188268 which bumps our Node.js version from v16 -> v18. Node.js no longer sorts the DNS lookup results from the OS. This might break situations where one might expect to connect to a ipv4 localhost but OS resolves
localhost
to ipv6 address, which would result inECONNREFUSED
. Node.js has provided a couple of different settings to control this behaviori) Process wide cli flag --dns-result-order=ipv4first|verbatim
ii) Per thread API in the dns module, dns.setDefaultResultOder
iii) Socket option autoSelectFamily to use happy eyeballs algorithm that will attempt to connect with ipv4 and ipv6 addresses until a connection is established.
I have adopted (i) in src/vs/server/node/extensionHostConnection.ts and src/vs/workbench/services/extensions/electron-sandbox/localProcessExtensionHost.ts to provide the old behavior in extension host spawned from both client and server. @alexdima let me know if we want to plan an action item to remove this workaround in future releases of VSCode.
This issue is created for callsites that are binding to
127.0.0.1
to verify if they are impacted by the Node.js change when connecting to these servers,The text was updated successfully, but these errors were encountered: