Skip to content

Resolve A/AAAA address families independently via AsyncDnsResolver - #20

Open
arturobernalg wants to merge 1 commit into
happy-eyeballs-connection-racingfrom
happy-eyeballs-async-dns
Open

arturobernalg wants to merge 1 commit into
happy-eyeballs-connection-racingfrom
happy-eyeballs-async-dns

Conversation

@arturobernalg

@arturobernalg arturobernalg commented Nov 10, 2026 •

Copy link
Copy Markdown
Owner

Resolves A and AAAA independently via an optional AsyncDnsResolver, racing whichever family arrives first.

Waits up to the RFC 8305 Resolution Delay (50ms) for AAAA if A arrives first, interleaving both if it does. Late addresses merge into the pending queue only, never touching an address already attempted.

Falls back to the plain DnsResolver when none is configured. Stacked on apache#935.

Optional AsyncDnsResolver SPI resolves A and AAAA independently and
reports each as it arrives, instead of behind one blocking call.
Racing starts on whichever family resolves first; if A arrives before
AAAA, wait up to the RFC 8305 Resolution Delay (50ms) for AAAA before
using A alone, interleaving both if AAAA does arrive in time.

Late-arriving addresses are merged into the still-pending part of the
race only: already-attempted addresses are left untouched, and the
pending addresses are rebuilt by family and re-interleaved (Section 6,
IPv6 first), rather than just appended after whatever was pending,
which would queue a newly-preferred AAAA address behind an older,
untried A address.

Without an AsyncDnsResolver configured, behavior is unchanged: a plain
DnsResolver can't honestly provide this (one blocking call can't split
into independent per-family results), so it isn't asked to fake it.
@arturobernalg
arturobernalg force-pushed the happy-eyeballs-async-dns branch from 570b1a2 to 7296a7f Compare November 11, 2026 04:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant