@@ -808,7 +808,7 @@ impl<C> Future for Request<C> {
808808 let request = this. request . as_mut ( ) . unwrap ( ) ;
809809 // TODO - would be nice if we didn't need to repeat this code twice, with & without retries.
810810 if request. retry >= this. retry_params . number_of_retries {
811- let next = if err. kind ( ) == ErrorKind :: ClusterConnectionNotFound {
811+ let next = if err. kind ( ) == ErrorKind :: AllConnectionsUnavailable {
812812 Next :: ReconnectToInitialNodes { request : None } . into ( )
813813 } else if matches ! ( err. retry_method( ) , crate :: types:: RetryMethod :: MovedRedirect )
814814 || matches ! ( target, OperationTarget :: NotFound )
@@ -836,7 +836,7 @@ impl<C> Future for Request<C> {
836836 }
837837 request. retry = request. retry . saturating_add ( 1 ) ;
838838
839- if err. kind ( ) == ErrorKind :: ClusterConnectionNotFound {
839+ if err. kind ( ) == ErrorKind :: AllConnectionsUnavailable {
840840 return Next :: ReconnectToInitialNodes {
841841 request : Some ( this. request . take ( ) . unwrap ( ) ) ,
842842 }
@@ -1132,12 +1132,7 @@ where
11321132 }
11331133 } ;
11341134 let mut write_lock = inner. conn_lock . write ( ) . await ;
1135- * write_lock = ConnectionsContainer :: new (
1136- Default :: default ( ) ,
1137- connection_map,
1138- inner. cluster_params . read_from_replicas ,
1139- 0 ,
1140- ) ;
1135+ write_lock. extend_connection_map ( connection_map) ;
11411136 drop ( write_lock) ;
11421137 if let Err ( err) = Self :: refresh_slots_and_subscriptions_with_retries (
11431138 inner. clone ( ) ,
@@ -1260,7 +1255,7 @@ where
12601255 } else {
12611256 Err ( last_err. unwrap_or_else ( || {
12621257 (
1263- ErrorKind :: ClusterConnectionNotFound ,
1258+ ErrorKind :: AllConnectionsUnavailable ,
12641259 "Couldn't find any connection" ,
12651260 )
12661261 . into ( )
@@ -1656,7 +1651,7 @@ where
16561651 return OperationResult :: Err ( (
16571652 OperationTarget :: FanOut ,
16581653 (
1659- ErrorKind :: ClusterConnectionNotFound ,
1654+ ErrorKind :: AllConnectionsUnavailable ,
16601655 "No connections found for multi-node operation" ,
16611656 )
16621657 . into ( ) ,
@@ -1700,7 +1695,7 @@ where
17001695 )
17011696 } else {
17021697 let _ = sender. send ( Err ( (
1703- ErrorKind :: ClusterConnectionNotFound ,
1698+ ErrorKind :: ConnectionNotFoundForRoute ,
17041699 "Connection not found" ,
17051700 )
17061701 . into ( ) ) ) ;
@@ -1871,7 +1866,7 @@ where
18711866 && !RoutingInfo :: is_key_routing_command ( & routable_cmd. unwrap ( ) )
18721867 {
18731868 return Err ( (
1874- ErrorKind :: ClusterConnectionNotFound ,
1869+ ErrorKind :: ConnectionNotFoundForRoute ,
18751870 "Requested connection not found for route" ,
18761871 format ! ( "{route:?}" ) ,
18771872 )
@@ -1892,7 +1887,7 @@ where
18921887 return Ok ( ( address, conn. await ) ) ;
18931888 } else {
18941889 return Err ( (
1895- ErrorKind :: ClusterConnectionNotFound ,
1890+ ErrorKind :: ConnectionNotFoundForRoute ,
18961891 "Requested connection not found" ,
18971892 address,
18981893 )
@@ -1938,7 +1933,7 @@ where
19381933 . random_connections ( 1 , ConnectionType :: User )
19391934 . next ( )
19401935 . ok_or ( RedisError :: from ( (
1941- ErrorKind :: ClusterConnectionNotFound ,
1936+ ErrorKind :: AllConnectionsUnavailable ,
19421937 "No random connection found" ,
19431938 ) ) ) ?;
19441939 return Ok ( ( random_address, random_conn_future. await ) ) ;
0 commit comments