@@ -532,6 +532,10 @@ def __init__(self,
532532 self .contact_points = contact_points
533533
534534 self .port = port
535+
536+ self .contact_points_resolved = [endpoint [4 ][0 ] for a in self .contact_points
537+ for endpoint in socket .getaddrinfo (a , self .port , socket .AF_UNSPEC , socket .SOCK_STREAM )]
538+
535539 self .compression = compression
536540 self .protocol_version = protocol_version
537541 self .auth_provider = auth_provider
@@ -830,7 +834,7 @@ def connect(self, keyspace=None):
830834 self .contact_points , self .protocol_version )
831835 self .connection_class .initialize_reactor ()
832836 atexit .register (partial (_shutdown_cluster , self ))
833- for address in self .contact_points :
837+ for address in self .contact_points_resolved :
834838 host , new = self .add_host (address , signal = False )
835839 if new :
836840 host .set_up ()
@@ -2320,7 +2324,7 @@ def _refresh_node_list_and_token_map(self, connection, preloaded_results=None,
23202324 if old_host .address != connection .host and old_host .address not in found_hosts :
23212325 should_rebuild_token_map = True
23222326 if old_host .address not in self ._cluster .contact_points :
2323- log .debug ("[control connection] Found host that has been removed : %r" , old_host )
2327+ log .debug ("[control connection] Removing host not found in peers metadata : %r" , old_host )
23242328 self ._cluster .remove_host (old_host )
23252329
23262330 log .debug ("[control connection] Finished fetching ring info" )
0 commit comments