@@ -119,11 +119,6 @@ class Http2Transport implements Transport {
119
119
* calls, and a ping should be sent the next time a call starts.
120
120
*/
121
121
private pendingSendKeepalivePing = false ;
122
- /**
123
- * Indicates when keepalives should no longer be performed for this transport. Used to prevent a race where a
124
- * latent session.ping(..) callback is called after the transport has been notified to disconnect.
125
- */
126
- private keepaliveDisabled = false ;
127
122
128
123
private userAgent : string ;
129
124
@@ -387,7 +382,6 @@ class Http2Transport implements Transport {
387
382
* Handle connection drops, but not GOAWAYs.
388
383
*/
389
384
private handleDisconnect ( ) {
390
- this . keepaliveDisabled = true ;
391
385
this . clearKeepaliveTimeout ( ) ;
392
386
this . reportDisconnectToOwner ( false ) ;
393
387
/* Give calls an event loop cycle to finish naturally before reporting the
@@ -396,6 +390,7 @@ class Http2Transport implements Transport {
396
390
for ( const call of this . activeCalls ) {
397
391
call . onDisconnect ( ) ;
398
392
}
393
+ this . session . destroy ( ) ;
399
394
} ) ;
400
395
}
401
396
@@ -405,7 +400,7 @@ class Http2Transport implements Transport {
405
400
406
401
private canSendPing ( ) {
407
402
return (
408
- ! this . keepaliveDisabled &&
403
+ ! this . session . destroyed &&
409
404
this . keepaliveTimeMs > 0 &&
410
405
( this . keepaliveWithoutCalls || this . activeCalls . size > 0 )
411
406
) ;
0 commit comments