Skip to content

Commit

Permalink
Merge pull request #2825 from murgatroid99/grpc-js_round_robin_reresolve
Browse files Browse the repository at this point in the history
grpc-js: round_robin: Request resolution on connection drop
  • Loading branch information
murgatroid99 authored Sep 16, 2024
2 parents a1b8972 + b3c24d0 commit 8841efe
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/grpc-js/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@grpc/grpc-js",
"version": "1.11.2",
"version": "1.11.3",
"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
7 changes: 7 additions & 0 deletions packages/grpc-js/src/load-balancer-round-robin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,13 @@ export class RoundRobinLoadBalancer implements LoadBalancer {
channelControlHelper,
{
updateState: (connectivityState, picker) => {
/* Ensure that name resolution is requested again after active
* connections are dropped. This is more aggressive than necessary to
* accomplish that, so we are counting on resolvers to have
* reasonable rate limits. */
if (this.currentState === ConnectivityState.READY && connectivityState !== ConnectivityState.READY) {
this.channelControlHelper.requestReresolution();
}
this.calculateAndUpdateState();
},
}
Expand Down

0 comments on commit 8841efe

Please sign in to comment.