-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
feat(client): implement rfc 6555 (happy eyeballs) #1598
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
Conversation
Awesome work, thanks! With regards to testing, I peeked at what Golang does. They make use of some special reserved IP addresses to test their happy eyeballs implementation: https://github.com/golang/go/blob/master/src/net/dial_test.go#L136 Would that help inspire some tests here? |
It appears that RFC 6555 has been obsoleted by https://tools.ietf.org/html/rfc8305 |
I've added a test, but I'm not really happy how it turned out. I needed to provide custom name resolver, which Hyper doesn't support, so I hacked one in, hidden behind non-default feature flag. It's crude and ugly solution. Instead, I can write a test directly for Anyway, I'm not really sure which options is better, or if there is a third one I missed. Regarding RFC 8305 @scrogson mentioned, I see it as a extension of work done here (correct me if I'm wrong). DNS part would require support for querying A records separately from AAAA records. |
Apparently Travis doesn't enable IPv6 by default (travis-ci/travis-ci#8361), so I copied workaround from one of the comments to make it work. I hope that's OK. |
I think this way sounds much better! I have no problem with inner tests when testing very specific behavior that is difficult to simulate in the integration tests. |
Update client connector to attempt a parallel connection using alternative address family, if connection using preferred address family takes too long. Closes: #1316
Done (and commits squashed). |
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.
Phenomenal! The code is clear, the comments are useful for "why", and test is thorough! ❤️
@seanmonstar @hban RFC 8305 (which obsoletes RFC 6555) seems to recommend 250ms for the timeout (section 5). I'm not super clear on what big changes are between 6555 and 8305 but it might be worth looking into. https://tools.ietf.org/html/rfc8305 See golang/go#23841 for some more concrete details Really awesome work by the way 💯 I can remove a bunch of hacks I currently have. |
First PR, criticism welcome!
Update client connector to attempt a parallel connection using alternative address family, if connection using preferred address family takes too long.
Some questions:
Closes: #1316