Merge pull request #1088 from murgatroid99/grpc-js_subchannel_cleanup

grpc-js: Close http2 sessions that are dropped by their subchannels
This commit is contained in:
Michael Lumish 2019-10-28 13:25:29 -07:00 committed by GitHub
commit 92f24eaae6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 0 deletions

View File

@ -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;