mirror of https://github.com/grpc/grpc-node.git
grpc-js: Transition subchannel to TRANSIENT_FAILURE when the socket closes
This commit is contained in:
parent
c96e7cfa2a
commit
55087d21c4
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@grpc/grpc-js",
|
||||
"version": "1.5.6",
|
||||
"version": "1.5.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",
|
||||
|
|
|
|||
|
|
@ -669,9 +669,15 @@ export class Subchannel {
|
|||
switch (newState) {
|
||||
case ConnectivityState.READY:
|
||||
this.stopBackoff();
|
||||
this.session!.socket.once('close', () => {
|
||||
for (const listener of this.disconnectListeners) {
|
||||
listener();
|
||||
const session = this.session!;
|
||||
session.socket.once('close', () => {
|
||||
if (this.session === session) {
|
||||
this.transitionToState(
|
||||
[ConnectivityState.READY],
|
||||
ConnectivityState.TRANSIENT_FAILURE);
|
||||
for (const listener of this.disconnectListeners) {
|
||||
listener();
|
||||
}
|
||||
}
|
||||
});
|
||||
if (this.keepaliveWithoutCalls) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue