mirror of https://github.com/grpc/grpc-node.git
grpc-js: pick-first: fix bad state transition when reconnecting connected LB
This commit is contained in:
parent
af5589be5a
commit
ee72cd440f
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@grpc/grpc-js",
|
||||
"version": "0.6.6",
|
||||
"version": "0.6.7",
|
||||
"description": "gRPC Library for Node - pure JS implementation",
|
||||
"homepage": "https://grpc.io/",
|
||||
"repository": "https://github.com/grpc/grpc-node/tree/master/packages/grpc-js",
|
||||
|
|
|
@ -312,10 +312,6 @@ export class PickFirstLoadBalancer implements LoadBalancer {
|
|||
subchannel.addConnectivityStateListener(this.subchannelStateListener);
|
||||
if (subchannel.getConnectivityState() === ConnectivityState.READY) {
|
||||
this.pickSubchannel(subchannel);
|
||||
this.updateState(
|
||||
ConnectivityState.READY,
|
||||
new PickFirstPicker(subchannel)
|
||||
);
|
||||
this.resetSubchannelList();
|
||||
return;
|
||||
}
|
||||
|
@ -327,16 +323,20 @@ export class PickFirstLoadBalancer implements LoadBalancer {
|
|||
subchannelState === ConnectivityState.CONNECTING
|
||||
) {
|
||||
this.startConnecting(index);
|
||||
if (this.currentPick === null) {
|
||||
this.updateState(ConnectivityState.CONNECTING, new QueuePicker(this));
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
// If the code reaches this point, every subchannel must be in TRANSIENT_FAILURE
|
||||
if (this.currentPick === null) {
|
||||
this.updateState(
|
||||
ConnectivityState.TRANSIENT_FAILURE,
|
||||
new UnavailablePicker()
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
updateAddressList(
|
||||
addressList: string[],
|
||||
|
|
Loading…
Reference in New Issue