-
-
Notifications
You must be signed in to change notification settings - Fork 31.7k
dgram: skip dns lookup for IPs #39473
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
base: main
Are you sure you want to change the base?
Conversation
I'd avoided PRing this myself, because I couldn't figure out the best way to share |
@schmod, good point, I got a rebase conflict somehow :/ so have to fix that regardless. With it loading internal/net for |
32feb15
to
ed6bfef
Compare
True, I'm not really worried about that. It's more about whether or not anybody's hot-patching any modules used downstream of That all being said, that sounds like an extreme edge-case, and might not be worth worrying about? |
While it may seem odd, this may be a breaking (semver-major) change. User code is permitted to provide a custom dns lookup function when the dgram/udp socket is created. Prior to this change, that function would be called for IP address values. |
This should include (a) a test case that verifies that the lookup function is not called and (b) a doc update indicating that a custom lookup function will not be invoked when the address is an IP address. |
We could preserve the current behavior if a custom |
Previously, we would call dns.lookup even for IP addresses in Socket#connect. This now skips that to improve performance. Fixes: nodejs#39468
They are currently failing due to us not emitting the appropriate addressType in the lookup event.
ed6bfef
to
6ee0ab0
Compare
@evanlucas - Would it be possible to revive this PR and complete the fix? There seems to be no work-around for dgram's socket implementation invoking DNS resolution on every single |
Previously, we would call dns.lookup even for IP addresses
in Socket#connect. This now skips that to improve performance.
Fixes: #39468