grpc-js: Handle keepalive ping error

This commit is contained in:
Michael Lumish 2023-08-31 09:30:26 -07:00
parent d1cb2d5f36
commit 83789c15db
1 changed files with 4 additions and 0 deletions

View File

@ -426,6 +426,10 @@ class Http2Transport implements Transport {
try {
this.session!.ping(
(err: Error | null, duration: number, payload: Buffer) => {
if (err) {
this.keepaliveTrace('Ping failed with error ' + err.message);
this.handleDisconnect();
}
this.keepaliveTrace('Received ping response');
this.clearKeepaliveTimeout();
this.maybeStartKeepalivePingTimer();