File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
Expand file tree Collapse file tree 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 {
249249 if ( ! ( this . currentState === connectivityState . TRANSIENT_FAILURE || this . currentState === connectivityState . CONNECTING ) ) {
250250 return ;
251251 }
252+ let firstIdleChild : LeafLoadBalancer | null = null ;
252253 for ( const leaf of this . leafMap . values ( ) ) {
253254 const leafState = leaf . getConnectivityState ( ) ;
254255 if ( leafState === connectivityState . CONNECTING ) {
256+ firstIdleChild = null ;
255257 break ;
256258 }
257- if ( leafState === connectivityState . IDLE ) {
258- leaf . startConnecting ( ) ;
259- break ;
259+ if ( leafState === connectivityState . IDLE && ! firstIdleChild ) {
260+ firstIdleChild = leaf ;
260261 }
261262 }
263+ if ( firstIdleChild ) {
264+ firstIdleChild . startConnecting ( ) ;
265+ }
262266 }
263267
264268 private calculateAndUpdateState ( ) {
You can’t perform that action at this time.
0 commit comments