File tree Expand file tree Collapse file tree 1 file changed +3
-7
lines changed Expand file tree Collapse file tree 1 file changed +3
-7
lines changed Original file line number Diff line number Diff line change @@ -739,6 +739,9 @@ def _open_connection_to_missing_shard(self, shard_id):
739
739
conn .shard_id ,
740
740
self .host
741
741
)
742
+ if self ._keyspace :
743
+ conn .set_keyspace_blocking (self ._keyspace )
744
+
742
745
self ._connections [conn .shard_id ] = conn
743
746
if old_conn is not None :
744
747
remaining = old_conn .in_flight - len (old_conn .orphaned_request_ids )
@@ -763,13 +766,6 @@ def _open_connection_to_missing_shard(self, shard_id):
763
766
old_conn .close ()
764
767
else :
765
768
self ._trash .add (old_conn )
766
- if self ._keyspace :
767
- with self ._lock :
768
- if self .is_shutdown :
769
- conn .close ()
770
- old_conn = self ._connections .get (conn .shard_id )
771
- if old_conn :
772
- old_conn .set_keyspace_blocking (self ._keyspace )
773
769
num_missing_or_needing_replacement = self .num_missing_or_needing_replacement
774
770
log .debug (
775
771
"Connected to %s/%i shards on host %s (%i missing or needs replacement)" ,
You can’t perform that action at this time.
0 commit comments