Skip to content

Commit 98cd87f

Browse files
authored
ensure that client keepalive timers are always cleared when they trigger. this is a necessary change to fit with having removed keepaliveDisabled boolean. manually inspected test logs for both server.ts and transport.ts to verify both types of keepalives are operating correctly.
1 parent 3c5ab22 commit 98cd87f

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

packages/grpc-js/src/transport.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -422,6 +422,7 @@ class Http2Transport implements Transport {
422422
'Sending ping with timeout ' + this.keepaliveTimeoutMs + 'ms'
423423
);
424424
this.keepaliveTimer = setTimeout(() => {
425+
this.keepaliveTimer = null;
425426
this.keepaliveTrace('Ping timeout passed without response');
426427
this.handleDisconnect();
427428
}, this.keepaliveTimeoutMs);
@@ -471,6 +472,7 @@ class Http2Transport implements Transport {
471472
'Starting keepalive timer for ' + this.keepaliveTimeMs + 'ms'
472473
);
473474
this.keepaliveTimer = setTimeout(() => {
475+
this.keepaliveTimer = null;
474476
this.maybeSendPing();
475477
}, this.keepaliveTimeMs);
476478
this.keepaliveTimer.unref?.();

0 commit comments

Comments
 (0)