On Wed, 25 Oct 2023 at 18:54, Daniele Varrazzo <daniele.varrazzo@gmail.com> wrote: > - connect_timeout > - multiple host, hostaddr, port > - load_balance_hosts=random > > Does this list sound complete?
I think you'd also want to resolve the hostnames to IPs yourself and iterate over those one-by-one. Otherwise if the first IP returned for the hostname times out, you will never connect to the others.
For async connections we were already unpacking and processing the hosts list, in order to perform non-blocking resolution and populate the hostaddr. This already accounted for the possibility of one host resolving to more than one address. But then we would have packed everything back into a single conninfo and made a single connection attempt.
The goal here was only non-blocking name resolution. Ahaini understand we should do is to split on the hosts for sync connections too, shuffle if requested, and make separate connection attempts.