Skip to content

Commit

Permalink
grpc-js: round_robin: Request resolution on connection drop
Browse files Browse the repository at this point in the history
  • Loading branch information
murgatroid99 committed Sep 12, 2024
1 parent 0c5ab98 commit b3c24d0
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 b3c24d0

Please sign in to comment.