Skip to content

Commit

Permalink
grpc-js: Handle keepalive ping error
Browse files Browse the repository at this point in the history
  • Loading branch information
murgatroid99 committed Aug 31, 2023
1 parent d1cb2d5 commit 83789c1
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/grpc-js/src/transport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 83789c1

Please sign in to comment.