Skip to content

Commit

Permalink
grpc-js: round robin: re-resolve when subchannels go idle
Browse files Browse the repository at this point in the history
  • Loading branch information
murgatroid99 committed Jan 19, 2021
1 parent 0b026be commit 36986f6
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 36986f6

Please sign in to comment.