c80d1b32903033df8db60e88d144b5638799b35a | Author: James Hartig <fastest963@gmail.com>
| 2019-10-22 11:29:36-05:00
Connect to peers synchronously only until ReadyPolicy is ready
This checks if the HostSelectionPolicy implements ReadyPolicy and will stop
blocking NewSession once Ready() returns true. If no ReadyPolicy was
configured, the previous behavior will stay the same and it will block
until all peers are connected. You can use SingleHostReadyPolicy to wrap an
existing HostSelectionPolicy and return ready once a single host has
connected.
This also cleans up the behavior around reconnecting and adding new nodes.
A node will be added as DOWN until it's connected then switch to UP.
Additionally, connecting the control connection does not count as the node being UP since
there's only the control connection.
When a query is run on a specific connection (rather than the session) it
will be pinned to that connection. This prevents inconsistencies or fetch
to be called on the session and get a different connection. This also
solves issues where the GetHosts call ends up trying to use the session
before it's ready.
Fixes #1365
2274c8a9fab68a2be1c558b32eab48cb853163aa | Author: James Hartig <fastest963@gmail.com>
| 2019-10-15 11:20:34-04:00
Don't send connectAddress when looping over peers (#1362)
This ends up associating the wrong connectAddress with each peer since we
don't overwrite connectAddress inside hostInfoFromMap.
Fixes #1361