Skip to content
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

[Android] Added Happy Eyeballs for address selection #32889

Conversation

marcesengel
Copy link
Contributor

@marcesengel marcesengel commented Jan 14, 2022

Summary

On android IPv6 issues can lead to very long loading times, as first all returned IPv6 addresses for a domain are tried until they timeout and after that IPv4 is used. This PR makes use of the Happy Eyeballs as suggested in #32730.

Changelog

[Android] [Feature] - Added Happy Eyeballs for network request target address selection

Test Plan

In my local wifi www.google.com was not reachable by IPv6, causing a timeout and failover on the first request. With the proposed PR the IPv4 request was started after the set timeout (t = a + (a * 1.5 ^ 1) + ... + (a * 1.5 ^ (n - 1)) for the nth request, where a = 400 ms) and was elected the winner, cancelling the IPv6 request.

The debug tools only showed one network request.

Edit: Also tried throwing an UnknownHostException in the lookup function, simulated every possible address failing by only calling call.cancel() in onConnectionAcquired and tried the selected address failing by calling call.cancel() at the end of onConnectionAcquired.

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jan 14, 2022
@marcesengel marcesengel force-pushed the feature/android-happy-eyeballs branch from 0c23f04 to cb650f0 Compare January 16, 2022 11:18
@marcesengel marcesengel changed the title Added android Happy Eyeballs for address selection [Android] Added Happy Eyeballs for address selection Jan 16, 2022
@andreialecu
Copy link

Note for reviewers:

Reddit deleted their IPv6 AAAA DNS records at one point probably to work around issues with their Android app not implementing Happy Eyeballs:

Ref:
https://www.reddit.com/r/ipv6/comments/r047ah/redditcom_has_deleted_aaaa_records_and_is_back_to/
https://www.reddit.com/r/ipv6/comments/qy70hv/new_phone_failing_to_load_any_ipv6_websites_on/hlebckp/?utm_source=reddit&utm_medium=web2x&context=3

This issue can be quite important.

@marcesengel marcesengel changed the base branch from 0.66-stable to main February 4, 2022 11:07
@marcesengel marcesengel requested a review from hramos as a code owner February 4, 2022 11:07
@marcesengel marcesengel changed the base branch from main to 0.66-stable February 4, 2022 11:07
@cortinico
Copy link
Contributor

See my comment on #33045 (comment) for next steps on how to proceed here.

@marcesengel marcesengel closed this Feb 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants