Skip to content

Commit cea545d

Browse files
authored
Merge pull request #2337 from murgatroid99/grpc-js_transport_fix_active_call_tracking
grpc-js: Fix tracking of active calls in transport
2 parents f29e99d + 3efdc7b commit cea545d

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

packages/grpc-js/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@grpc/grpc-js",
3-
"version": "1.8.6",
3+
"version": "1.8.7",
44
"description": "gRPC Library for Node - pure JS implementation",
55
"homepage": "https://grpc.io/",
66
"repository": "https://github.com/grpc/grpc-node/tree/master/packages/grpc-js",

packages/grpc-js/src/transport.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -354,16 +354,20 @@ class Http2Transport implements Transport {
354354

355355
private removeActiveCall(call: Http2SubchannelCall) {
356356
this.activeCalls.delete(call);
357-
if (this.activeCalls.size === 0 && !this.keepaliveWithoutCalls) {
357+
if (this.activeCalls.size === 0) {
358358
this.session.unref();
359-
this.stopKeepalivePings();
359+
if (!this.keepaliveWithoutCalls) {
360+
this.stopKeepalivePings();
361+
}
360362
}
361363
}
362364

363365
private addActiveCall(call: Http2SubchannelCall) {
364-
if (this.activeCalls.size === 0 && !this.keepaliveWithoutCalls) {
366+
if (this.activeCalls.size === 0) {
365367
this.session.ref();
366-
this.startKeepalivePings();
368+
if (!this.keepaliveWithoutCalls) {
369+
this.startKeepalivePings();
370+
}
367371
}
368372
this.activeCalls.add(call);
369373
}

0 commit comments

Comments
 (0)