Merge pull request #1323 from orgads/pick-first-lb

PickFirstLoadBalancer: Correctly initialize state counters
This commit is contained in:
Michael Lumish 2020-03-31 14:30:59 -07:00 committed by GitHub
commit 01d26b35bb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 0 deletions

View File

@ -350,6 +350,7 @@ export class PickFirstLoadBalancer implements LoadBalancer {
}
for (const subchannel of this.subchannels) {
subchannel.addConnectivityStateListener(this.subchannelStateListener);
this.subchannelStateCounts[subchannel.getConnectivityState()] += 1;
if (subchannel.getConnectivityState() === ConnectivityState.READY) {
this.pickSubchannel(subchannel);
this.resetSubchannelList();