Skip to main content

Module failover

Module failover 

Source
Expand description

Connection-phase Happy Eyeballs (RFC 8305 section 5) for client dials.

DNS often returns both IPv6 and IPv4 addresses, and either family can be silently broken (an unrouted AAAA, a blocked v4 path). Rather than dial one address and wait out the handshake timeout, a dial staggers attempts across every resolved address, alternating families, and takes the first connection to complete. The stagger is crate::ClientConfig::failover_delay.

The addresses arrive from the DNS phase as they resolve, and in the order the platform’s own resolver put them in, so a lookup still waiting on its AAAA record no longer holds up the first attempt. How long that first attempt holds back for the full answer is crate::ClientConfig::resolution_delay.

Nothing here needs calling: every client dial goes through it. The one type a consumer sees is Failure, which the backend Error types carry when the race loses every attempt.

Structs§

Failure
One failed connection attempt, naming the address it dialed.