Metadata | Value |
---|---|
Date | 2021-07-21 |
Author | @kozlovic |
Status | Approved |
Tags | client |
The client library should take a random IP address when performing a host name resolution prior to creating the TCP connection.
The Go client is doing host name resolution as shown here
and then shuffle this list (unless the NoRandomize
option is enabled) as shown here
When the library is about to create a TCP connection, if given a host name (and not an IP), a name resolution must be performed.
If the list has more than 1 IP returned, it should be randomized, unless the existing NoRandomize
option is enabled.
We could introduce a new option specific to this IP list as opposed to the server URLs provided by the user.
Then the connection should happen in the order of the shuffled list and stop as soon as one is successful.
This was driven by the fact that the Go client behaves as described above and some users have shown interest in all clients behaving this way. Some users have DNS where the order almost never change, which with client libraries not performing randomization, would cause all clients to connect to the same server.
This should be considered as a CHANGE for client libraries, since we are changing the default behavior.
If it is strongly felt that this new default behavior should have an opt-out, other than the use of the existing NoRandomize
option, a new option can be introduced to disable this new default behavior.