Skip to content

Commit 2f090c6

Browse files
mattias-wibergmurgatroid99
authored andcommitted
grpc-js: Fix server keep alive timeout not properly destroying connections
1 parent 425e7cb commit 2f090c6

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

packages/grpc-js/src/server.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1609,7 +1609,7 @@ export class Server {
16091609
if (err) {
16101610
this.keepaliveTrace('Ping failed with error: ' + err.message);
16111611
sessionClosedByServer = true;
1612-
session.close();
1612+
session.destroy();
16131613
} else {
16141614
this.keepaliveTrace('Received ping response');
16151615
maybeStartKeepalivePingTimer();
@@ -1631,7 +1631,7 @@ export class Server {
16311631
'Connection dropped due to ping send error: ' + pingSendError
16321632
);
16331633
sessionClosedByServer = true;
1634-
session.close();
1634+
session.destroy();
16351635
return;
16361636
}
16371637

@@ -1640,7 +1640,7 @@ export class Server {
16401640
this.keepaliveTrace('Ping timeout passed without response');
16411641
this.trace('Connection dropped by keepalive timeout');
16421642
sessionClosedByServer = true;
1643-
session.close();
1643+
session.destroy();
16441644
}, this.keepaliveTimeoutMs);
16451645
keepaliveTimer.unref?.();
16461646
};
@@ -1803,7 +1803,7 @@ export class Server {
18031803
duration
18041804
);
18051805
sessionClosedByServer = true;
1806-
session.close();
1806+
session.destroy();
18071807
} else {
18081808
this.keepaliveTrace('Received ping response');
18091809
maybeStartKeepalivePingTimer();
@@ -1826,7 +1826,7 @@ export class Server {
18261826
'Connection dropped due to ping send error: ' + pingSendError
18271827
);
18281828
sessionClosedByServer = true;
1829-
session.close();
1829+
session.destroy();
18301830
return;
18311831
}
18321832

@@ -1840,7 +1840,7 @@ export class Server {
18401840
'Connection dropped by keepalive timeout from ' + clientAddress
18411841
);
18421842
sessionClosedByServer = true;
1843-
session.close();
1843+
session.destroy();
18441844
}, this.keepaliveTimeoutMs);
18451845
keepaliveTimeout.unref?.();
18461846
};

0 commit comments

Comments
 (0)