Happy eyeballs is a way to prefer IPv6 connections over IPv4 ones, and still work with IPv4.
The way our current implementation works:
* If the first IP address in our list is IPv4, or all the IP addresses are IPv4 or IPv6, just try all the addresses serially. Only try the next IP after connecting to the previous one returned an error.
* Otherwise, try to connect to them all in order, as above. But if connecting to them all (in order) takes more than 200 milliseconds, create a copy of the address list, with all the IPv4 addresses in font (But that still has the IPv6 addresses), and race trying them all in order against trying all entries in the old list in order.
That means when we use happy eyeballs, we potentially try and connect to all IP addresses twice, which seems inefficient.
There are other options here - make one sub-job only connect to IPv6, and the other only connect to IPv4, for instance, though that would have the disadvantage of potentially preferring low-priority IPv6 addresses later in the list over IPv4 addresses earleir in the list (That having been said, the current implementation does potentially prefer low-priority IPv4 addresses over earlier IPv6 addresses). Another alternative would be to just make sure the IPv4 and "IPv6" tasks each skip addresses already looked up.
Anyhow, I think cleaning this up is fairly low priority.
Comment 1 by mmenke@chromium.org
, Dec 21