From e2bb127bb59b280b8b6b0b7c784dbb0dfc7d1bd7 Mon Sep 17 00:00:00 2001 From: murgatroid99 Date: Mon, 28 Oct 2019 10:33:59 -0700 Subject: [PATCH] grpc-js: Close http2 sessions that are dropped by their subchannels --- packages/grpc-js/src/subchannel.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/grpc-js/src/subchannel.ts b/packages/grpc-js/src/subchannel.ts index 9a207a5f..4edce3c1 100644 --- a/packages/grpc-js/src/subchannel.ts +++ b/packages/grpc-js/src/subchannel.ts @@ -321,6 +321,9 @@ export class Subchannel { this.continueConnecting = false; break; case ConnectivityState.TRANSIENT_FAILURE: + if (this.session) { + this.session.close(); + } this.session = null; this.stopKeepalivePings(); break; @@ -329,6 +332,9 @@ export class Subchannel { * should only transition to the IDLE state as a result of the timer * ending, but we still want to reset the backoff timeout. */ this.stopBackoff(); + if (this.session) { + this.session.close(); + } this.session = null; this.stopKeepalivePings(); break;