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
Happy Eyeballs support (address IPv6 issues in Node 17) #41625
Comments
|
I agree Node.js would benefit having this built-in. Is this something you'd be interested in working on @andreialecu? |
|
I am not sure what subsystem this would fit into. It seems that Happy Eyeballs not only applies to HTTP ( |
|
There's a writeup on how this is implemented in OSX here by an Apple engineer: https://mailarchive.ietf.org/arch/msg/v6ops/DYiI9v_O66RNbMJsx0NsatFkubQ
There's also an official RFC at: https://datatracker.ietf.org/doc/html/rfc8305 Since it deals with SYN packets, I'm not sure if this can be implemented in JS land or it needs to touch the C++ networking layer. I'm not familiar at all with nodejs networking internals. |
|
Yes, I believe it should go into Happy Eyeballs with UDP being connectionless is a bit more complicated. |
Mostly, yes, at least by default.
I am wondering how much complexity we can justify just to work around broken IPv6 stacks. The algorithms seem useful even beyond IPv6 compatibility, but so far I have no idea how we could implement this. We probably cannot do this for all TCP connections, at least not by default. We could maybe add an option to |
Why not? If I am not wrong this is the default for all Happy Eyeballs implementations. Though it uses some kind of cache. |
That statement is probably not factual. At least not at scale. Even if 1% of users are affected, depending on the number of users, that can add up quite a bit. Reddit has recently disabled IPv6 due to issues they were having: Also their Android app does not implement Happy Eyeballs, and here's a report specifically pinpointing this to be the problem: There's also a huge thread here: aws-amplify/amplify-js#5539 about an Android only issue that I was also running into, and which was specifically about Happy Eyeballs. Additionally, there are many other threads in other JS ecosystems related to Happy Eyeballs: facebook/react-native#29608 (comment) There are tons of reports still popping up. And it goes unreported most of the time, because it's very random and pretty much unreproducible since it's hard to actually pin it down to IPv6 being the culprit. |
|
@andreialecu Don't get me wrong, I am not saying there are no issues. I frequently run into some myself. That was just me quoting Wikipedia. IPv6 is older than myself and I really wish we didn't have to worry about broken IPv6 stacks at this point Either way, as I said in my last comment, someone would probably have to implement this in |
Perhaps this might help with that: https://github.com/shtrom/happy-eyeballs-c |
Not necessary, just call |
My understanding was that libuv might establish multiple connections in that case, whereas the algorithm above only sends SYNs until one receives a reply. Maybe that's wrong, or maybe establishing connections isn't that bad. |
|
You |
|
There has been no activity on this feature request for 5 months and it is unlikely to be implemented. It will be closed 6 months after the last non-automated comment. For more information on how the project manages feature requests, please consult the feature request management document. |
While Reddit is still in a staged rollout of IPv6, they've already published about implementing Happy Eyeballs on Android: https://www.reddit.com/r/RedditEng/comments/v1upr8/ipv6_support_on_android/ |


andreialecu commentedJan 21, 2022
•
edited
What is the problem this feature will solve?
It appears that node 17 has merged this PR: #39987 which may result in IPv6 addresses being sorted first.
As per an answer in this reddit thread from @treysis: https://www.reddit.com/r/ipv6/comments/qbr8jc/comment/hhmg7uz/?context=3 it appears that Happy Eyeballs is not implemented however.
The lack of Happy Eyeballs support can result in connections failing. In particular, there are a lot of data points related to similar support lacking from the OkHttp library which is used heavily on Android and results in connectivity issues for a relatively big number of users. Ref: square/okhttp#506 (comment)
The problem is that consumer routers sometimes glitch out on IPv6.
A router I manage in one particular location, which is a consumer grade TP-Link router, will routinely hang on IPv6 connections about once per month, until it is restarted. More on this here: square/okhttp#6954 (comment)
I have noticed that Node 17 will then pretty much hang on outgoing connections for up to one minute before eventually being able to connect. Restarting the router resolves the issue.
What is the feature you are proposing to solve the problem?
Implement the Happy Eyeballs algorithm.
What alternatives have you considered?
There is an user-land patch here: https://www.npmjs.com/package/happy-eyeballs by @zwhitchcox which might help as a workaround.
The text was updated successfully, but these errors were encountered: