-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
fix(ext/node): enable reuseport for net Socket on macOS #20869
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does SO_REUSEPORT
do on macOS? When I originally implemented this for Linux, I didn't do macOS because there was no reason for anyone to use it (because it behaves different on macOS - it steals rather than balances). What do these packages use it for?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also I think you don't want SO_REUSEPORT, but SO_REUSEADDR (and enable that by default everywhere). libuv does not enable (or let you enable) SO_REUSEPORT on TCP sockets anywhere (including macOS). It does enable SO_REUSEADDR on all Unix.
@lucacasonato is right. libuv does not set SO_REUSEPORT for TCP (UDP only on BSDs) It looks like portfinder is also flaky/broken in Node -
@bartlomieju How should we proceed? |
@littledivy I'm not sure yet - but given this package is popular we need to come up with some solution that will work in most cases (compared to always crashing right now). |
Closing because stale. |
net.Socket
TCP sockets are set toSO_REUSEPORT
.Fixes #20618
Fixes #18301
Modules working:
npm:http-server
,npm:portfinder
and Vuepress dev server