Skip to content

Commit b3c24d0

Browse files
committed
grpc-js: round_robin: Request resolution on connection drop
1 parent 0c5ab98 commit b3c24d0

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

packages/grpc-js/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@grpc/grpc-js",
3-
"version": "1.11.2",
3+
"version": "1.11.3",
44
"description": "gRPC Library for Node - pure JS implementation",
55
"homepage": "https://grpc.io/",
66
"repository": "https://github.com/grpc/grpc-node/tree/master/packages/grpc-js",

packages/grpc-js/src/load-balancer-round-robin.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,13 @@ export class RoundRobinLoadBalancer implements LoadBalancer {
110110
channelControlHelper,
111111
{
112112
updateState: (connectivityState, picker) => {
113+
/* Ensure that name resolution is requested again after active
114+
* connections are dropped. This is more aggressive than necessary to
115+
* accomplish that, so we are counting on resolvers to have
116+
* reasonable rate limits. */
117+
if (this.currentState === ConnectivityState.READY && connectivityState !== ConnectivityState.READY) {
118+
this.channelControlHelper.requestReresolution();
119+
}
113120
this.calculateAndUpdateState();
114121
},
115122
}

0 commit comments

Comments
 (0)