grpc-js: round robin: re-resolve when subchannels go idle

This commit is contained in:
Michael Lumish 2021-01-19 13:43:56 -08:00
parent 0b026be131
commit 36986f618a
2 changed files with 3 additions and 5 deletions

View File

@ -1,6 +1,6 @@
{ {
"name": "@grpc/grpc-js", "name": "@grpc/grpc-js",
"version": "1.2.3", "version": "1.2.4",
"description": "gRPC Library for Node - pure JS implementation", "description": "gRPC Library for Node - pure JS implementation",
"homepage": "https://grpc.io/", "homepage": "https://grpc.io/",
"repository": "https://github.com/grpc/grpc-node/tree/master/packages/grpc-js", "repository": "https://github.com/grpc/grpc-node/tree/master/packages/grpc-js",

View File

@ -129,13 +129,11 @@ export class RoundRobinLoadBalancer implements LoadBalancer {
this.subchannelStateCounts[newState] += 1; this.subchannelStateCounts[newState] += 1;
this.calculateAndUpdateState(); this.calculateAndUpdateState();
if (newState === ConnectivityState.TRANSIENT_FAILURE) {
this.channelControlHelper.requestReresolution();
}
if ( if (
newState === ConnectivityState.TRANSIENT_FAILURE || newState === ConnectivityState.TRANSIENT_FAILURE ||
newState === ConnectivityState.IDLE newState === ConnectivityState.IDLE
) { ) {
this.channelControlHelper.requestReresolution();
subchannel.startConnecting(); subchannel.startConnecting();
} }
}; };