mirror of https://github.com/grpc/grpc-node.git
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:
parent
3c5ab229b1
commit
98cd87f751
|
@ -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?.();
|
||||
|
|
Loading…
Reference in New Issue