mirror of https://github.com/grpc/grpc-node.git
grpc-js: round robin: re-resolve when subchannels go idle
This commit is contained in:
parent
0b026be131
commit
36986f618a
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "@grpc/grpc-js",
|
"name": "@grpc/grpc-js",
|
||||||
"version": "1.2.3",
|
"version": "1.2.4",
|
||||||
"description": "gRPC Library for Node - pure JS implementation",
|
"description": "gRPC Library for Node - pure JS implementation",
|
||||||
"homepage": "https://grpc.io/",
|
"homepage": "https://grpc.io/",
|
||||||
"repository": "https://github.com/grpc/grpc-node/tree/master/packages/grpc-js",
|
"repository": "https://github.com/grpc/grpc-node/tree/master/packages/grpc-js",
|
||||||
|
|
|
@ -129,13 +129,11 @@ export class RoundRobinLoadBalancer implements LoadBalancer {
|
||||||
this.subchannelStateCounts[newState] += 1;
|
this.subchannelStateCounts[newState] += 1;
|
||||||
this.calculateAndUpdateState();
|
this.calculateAndUpdateState();
|
||||||
|
|
||||||
if (newState === ConnectivityState.TRANSIENT_FAILURE) {
|
|
||||||
this.channelControlHelper.requestReresolution();
|
|
||||||
}
|
|
||||||
if (
|
if (
|
||||||
newState === ConnectivityState.TRANSIENT_FAILURE ||
|
newState === ConnectivityState.TRANSIENT_FAILURE ||
|
||||||
newState === ConnectivityState.IDLE
|
newState === ConnectivityState.IDLE
|
||||||
) {
|
) {
|
||||||
|
this.channelControlHelper.requestReresolution();
|
||||||
subchannel.startConnecting();
|
subchannel.startConnecting();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue