Skip to main content

Module failover

Module failover 

Source
Expand description

Happy Eyeballs (RFC 8305) address failover 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.

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.