Skip to content

Commit

Permalink
Merge pull request #1665 from murgatroid99/grpc-js_round_robin_rereso…
Browse files Browse the repository at this point in the history
…lve_fix

grpc-js: round robin: re-resolve when subchannels go idle
  • Loading branch information
murgatroid99 committed Jan 20, 2021
2 parents 0b026be + 36986f6 commit c328ba7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion packages/grpc-js/package.json
@@ -1,6 +1,6 @@
{
"name": "@grpc/grpc-js",
"version": "1.2.3",
"version": "1.2.4",
"description": "gRPC Library for Node - pure JS implementation",
"homepage": "https://grpc.io/",
"repository": "https://github.com/grpc/grpc-node/tree/master/packages/grpc-js",
Expand Down
6 changes: 2 additions & 4 deletions packages/grpc-js/src/load-balancer-round-robin.ts
Expand Up @@ -128,14 +128,12 @@ export class RoundRobinLoadBalancer implements LoadBalancer {
this.subchannelStateCounts[previousState] -= 1;
this.subchannelStateCounts[newState] += 1;
this.calculateAndUpdateState();

if (newState === ConnectivityState.TRANSIENT_FAILURE) {
this.channelControlHelper.requestReresolution();
}

if (
newState === ConnectivityState.TRANSIENT_FAILURE ||
newState === ConnectivityState.IDLE
) {
this.channelControlHelper.requestReresolution();
subchannel.startConnecting();
}
};
Expand Down

0 comments on commit c328ba7

Please sign in to comment.