File tree 1 file changed +7
-3
lines changed
1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -249,16 +249,20 @@ class RingHashLoadBalancer implements LoadBalancer {
249
249
if ( ! ( this . currentState === connectivityState . TRANSIENT_FAILURE || this . currentState === connectivityState . CONNECTING ) ) {
250
250
return ;
251
251
}
252
+ let firstIdleChild : LeafLoadBalancer | null = null ;
252
253
for ( const leaf of this . leafMap . values ( ) ) {
253
254
const leafState = leaf . getConnectivityState ( ) ;
254
255
if ( leafState === connectivityState . CONNECTING ) {
256
+ firstIdleChild = null ;
255
257
break ;
256
258
}
257
- if ( leafState === connectivityState . IDLE ) {
258
- leaf . startConnecting ( ) ;
259
- break ;
259
+ if ( leafState === connectivityState . IDLE && ! firstIdleChild ) {
260
+ firstIdleChild = leaf ;
260
261
}
261
262
}
263
+ if ( firstIdleChild ) {
264
+ firstIdleChild . startConnecting ( ) ;
265
+ }
262
266
}
263
267
264
268
private calculateAndUpdateState ( ) {
You can’t perform that action at this time.
0 commit comments