From 630897244e7f7407c617955f9d0e1f28fb6ea69c Mon Sep 17 00:00:00 2001 From: murgatroid99 Date: Mon, 3 Feb 2020 10:44:58 -0800 Subject: [PATCH] grpc-js: Destroy http2 stream when a call ends in any way --- packages/grpc-js/src/call-stream.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/grpc-js/src/call-stream.ts b/packages/grpc-js/src/call-stream.ts index c1e9b3b5..ee21d19f 100644 --- a/packages/grpc-js/src/call-stream.ts +++ b/packages/grpc-js/src/call-stream.ts @@ -163,6 +163,9 @@ export class Http2CallStream extends Duplex implements Call { * @param status The status of the call. */ private endCall(status: StatusObject): void { + /* Once endCall is called, we are definitely not using the http2 stream + * anymore, so we can always safely destroy it here */ + this.destroyHttp2Stream(); if (this.finalStatus === null) { this.trace( 'ended with status: code=' +