Skip to content

Commit

Permalink
Merge pull request #2563 from murgatroid99/grpc-js_handle_keepalive_e…
Browse files Browse the repository at this point in the history
…rror

grpc-js: Handle keepalive ping error
  • Loading branch information
murgatroid99 authored Aug 31, 2023
2 parents d1cb2d5 + 83789c1 commit 4475a9f
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 4475a9f

Please sign in to comment.