This issue has two parts:
- Support transportation layer connection timeout described in KIP-601
- Optimize the logic for NetworkClient.leastLoadedNode()
- Added a new common client configuration parameter socket.connection.setup.timeout.ms to the NetworkClient. Handle potential transportation layer timeout using the same approach as it handling potential request timeout.
- When no connected channel exists, leastLoadedNode() will now provide a disconnected node that has the least number of failed attempts.
- ClusterConnectionStates will keep the connecting node ids. Now it also has several new public methods to provide per connection relavant data.