@@ -808,7 +808,7 @@ impl<C> Future for Request<C> {
808
808
let request = this. request . as_mut ( ) . unwrap ( ) ;
809
809
// TODO - would be nice if we didn't need to repeat this code twice, with & without retries.
810
810
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 {
812
812
Next :: ReconnectToInitialNodes { request : None } . into ( )
813
813
} else if matches ! ( err. retry_method( ) , crate :: types:: RetryMethod :: MovedRedirect )
814
814
|| matches ! ( target, OperationTarget :: NotFound )
@@ -836,7 +836,7 @@ impl<C> Future for Request<C> {
836
836
}
837
837
request. retry = request. retry . saturating_add ( 1 ) ;
838
838
839
- if err. kind ( ) == ErrorKind :: ClusterConnectionNotFound {
839
+ if err. kind ( ) == ErrorKind :: AllConnectionsUnavailable {
840
840
return Next :: ReconnectToInitialNodes {
841
841
request : Some ( this. request . take ( ) . unwrap ( ) ) ,
842
842
}
@@ -1132,12 +1132,7 @@ where
1132
1132
}
1133
1133
} ;
1134
1134
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) ;
1141
1136
drop ( write_lock) ;
1142
1137
if let Err ( err) = Self :: refresh_slots_and_subscriptions_with_retries (
1143
1138
inner. clone ( ) ,
@@ -1260,7 +1255,7 @@ where
1260
1255
} else {
1261
1256
Err ( last_err. unwrap_or_else ( || {
1262
1257
(
1263
- ErrorKind :: ClusterConnectionNotFound ,
1258
+ ErrorKind :: AllConnectionsUnavailable ,
1264
1259
"Couldn't find any connection" ,
1265
1260
)
1266
1261
. into ( )
@@ -1656,7 +1651,7 @@ where
1656
1651
return OperationResult :: Err ( (
1657
1652
OperationTarget :: FanOut ,
1658
1653
(
1659
- ErrorKind :: ClusterConnectionNotFound ,
1654
+ ErrorKind :: AllConnectionsUnavailable ,
1660
1655
"No connections found for multi-node operation" ,
1661
1656
)
1662
1657
. into ( ) ,
@@ -1700,7 +1695,7 @@ where
1700
1695
)
1701
1696
} else {
1702
1697
let _ = sender. send ( Err ( (
1703
- ErrorKind :: ClusterConnectionNotFound ,
1698
+ ErrorKind :: ConnectionNotFoundForRoute ,
1704
1699
"Connection not found" ,
1705
1700
)
1706
1701
. into ( ) ) ) ;
@@ -1871,7 +1866,7 @@ where
1871
1866
&& !RoutingInfo :: is_key_routing_command ( & routable_cmd. unwrap ( ) )
1872
1867
{
1873
1868
return Err ( (
1874
- ErrorKind :: ClusterConnectionNotFound ,
1869
+ ErrorKind :: ConnectionNotFoundForRoute ,
1875
1870
"Requested connection not found for route" ,
1876
1871
format ! ( "{route:?}" ) ,
1877
1872
)
@@ -1892,7 +1887,7 @@ where
1892
1887
return Ok ( ( address, conn. await ) ) ;
1893
1888
} else {
1894
1889
return Err ( (
1895
- ErrorKind :: ClusterConnectionNotFound ,
1890
+ ErrorKind :: ConnectionNotFoundForRoute ,
1896
1891
"Requested connection not found" ,
1897
1892
address,
1898
1893
)
@@ -1938,7 +1933,7 @@ where
1938
1933
. random_connections ( 1 , ConnectionType :: User )
1939
1934
. next ( )
1940
1935
. ok_or ( RedisError :: from ( (
1941
- ErrorKind :: ClusterConnectionNotFound ,
1936
+ ErrorKind :: AllConnectionsUnavailable ,
1942
1937
"No random connection found" ,
1943
1938
) ) ) ?;
1944
1939
return Ok ( ( random_address, random_conn_future. await ) ) ;
0 commit comments