File tree 3 files changed +4
-4
lines changed
common/client-libs/multi-tcp-client/src
3 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -121,7 +121,7 @@ impl<'a> ConnectionManager<'static> {
121
121
async fn handle_new_message ( & mut self , msg : Vec < u8 > ) -> io:: Result < ( ) > {
122
122
if let ConnectionState :: Reconnecting ( conn_reconnector) = & mut self . state {
123
123
// do a single poll rather than await for future to completely resolve
124
- let new_connection = match futures:: poll! ( conn_reconnector) {
124
+ let new_connection = match futures:: poll ( conn_reconnector) . await {
125
125
Poll :: Pending => {
126
126
return Err ( io:: Error :: new (
127
127
io:: ErrorKind :: BrokenPipe ,
Original file line number Diff line number Diff line change @@ -71,7 +71,6 @@ impl<'a> Future for ConnectionReconnector<'a> {
71
71
"we failed to re-establish connection to {} - {:?} (attempt {})" ,
72
72
self . address, e, self . current_retry_attempt
73
73
) ;
74
- self . current_retry_attempt += 1 ;
75
74
76
75
// we failed to re-establish connection - continue exponential backoff
77
76
@@ -95,6 +94,7 @@ impl<'a> Future for ConnectionReconnector<'a> {
95
94
self . current_backoff_delay . reset ( next) ;
96
95
97
96
self . connection = tokio:: net:: TcpStream :: connect ( self . address ) . boxed ( ) ;
97
+ self . current_retry_attempt += 1 ;
98
98
99
99
Poll :: Pending
100
100
}
Original file line number Diff line number Diff line change @@ -60,8 +60,8 @@ impl Client {
60
60
runtime_handle : Handle :: try_current ( )
61
61
. expect ( "The client MUST BE used within tokio runtime context" ) ,
62
62
connections_managers : HashMap :: new ( ) ,
63
- initial_reconnection_backoff : config. maximum_reconnection_backoff ,
64
- maximum_reconnection_backoff : config. initial_reconnection_backoff ,
63
+ initial_reconnection_backoff : config. initial_reconnection_backoff ,
64
+ maximum_reconnection_backoff : config. maximum_reconnection_backoff ,
65
65
initial_connection_timeout : config. initial_connection_timeout ,
66
66
}
67
67
}
You can’t perform that action at this time.
0 commit comments