When a client (or relay, when that time comes(*)) fails to connect to
an OR port it should try using another OR port for the relay it's
trying to connect to, if there is one.
(*) relay to relay as well as relay to authority connections
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Child items 0
Show closed items
No child items are currently assigned. Use child items to break down this issue into smaller parts.
Linked items 0
Link issues together to show that they're related.
Learn more.
Fortunately, this ticket is not as necessary as it used to be, because Tor picks a small set of guards / directory guards that it can connect to and sticks with them. Many OR (and some Dir) destinations are actually tunneled via tor, so only the guards' ORPorts actually matter.
try to connect to the preferred ORPort (address/port)
when the connection fails, or if it hasn't succeeded after N seconds, try to connect to the other ORPort (if any)
Close all other connection attempts to the same server when the first connects
We might need to do this for some DirPort connections as well.
I think it's OK for us to just try another directory server on failure as we typically do. But if we had reasons to pick that specific server, and we were making a direct connection to it (do we ever do this?), then using the alternate DirPort (address) would be good.
We discovered in #18348 (moved) that we'll definitely need to do this for DirPorts as well. As it's the same code, and some DirPort connections are tunneled, it's best handled in the same place.
Trac: Summary: Fall back to alternative OR port if the current fails to Fall back to alternative OR or Dir port if the current fails
Existing client guard code already implements this feature by trying another guard if one fails.
#24403 (moved) will make relays retry IPv4 and IPv6 when an EXTEND has both addresses.
#17835 (moved) should do the same for client connections to entry nodes.
(If a specific entry node is required (single onion services only?), we should choose an available address at random. If not, we should do what the existing guard code does, and choose another entry node at random - because we are more likely to succeed than a retry.)