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.

This commit is contained in:
David Fiala 2024-06-06 22:57:13 -07:00 committed by GitHub
parent 3c5ab229b1
commit 98cd87f751
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 0 deletions

View File

@ -422,6 +422,7 @@ class Http2Transport implements Transport {
'Sending ping with timeout ' + this.keepaliveTimeoutMs + 'ms'
);
this.keepaliveTimer = setTimeout(() => {
this.keepaliveTimer = null;
this.keepaliveTrace('Ping timeout passed without response');
this.handleDisconnect();
}, this.keepaliveTimeoutMs);
@ -471,6 +472,7 @@ class Http2Transport implements Transport {
'Starting keepalive timer for ' + this.keepaliveTimeMs + 'ms'
);
this.keepaliveTimer = setTimeout(() => {
this.keepaliveTimer = null;
this.maybeSendPing();
}, this.keepaliveTimeMs);
this.keepaliveTimer.unref?.();