Skip to content

Commit

Permalink
grpc-js: Fix call ref timer handling
Browse files Browse the repository at this point in the history
  • Loading branch information
murgatroid99 committed Dec 1, 2023
1 parent 202a735 commit 4dfd8c4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion packages/grpc-js/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@grpc/grpc-js",
"version": "1.9.12",
"version": "1.9.13",
"description": "gRPC Library for Node - pure JS implementation",
"homepage": "https://grpc.io/",
"repository": "https://github.com/grpc/grpc-node/tree/master/packages/grpc-js",
Expand Down
13 changes: 9 additions & 4 deletions packages/grpc-js/src/internal-channel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,9 @@ export class InternalChannel {
this.currentPicker = picker;
const queueCopy = this.pickQueue.slice();
this.pickQueue = [];
this.callRefTimerUnref();
if (queueCopy.length > 0) {
this.callRefTimerUnref();
}
for (const call of queueCopy) {
call.doPick();
}
Expand Down Expand Up @@ -349,11 +351,12 @@ export class InternalChannel {
process.nextTick(() => {
const localQueue = this.configSelectionQueue;
this.configSelectionQueue = [];
this.callRefTimerUnref();
if (localQueue.length > 0) {
this.callRefTimerUnref();
}
for (const call of localQueue) {
call.getConfig();
}
this.configSelectionQueue = [];
});
},
status => {
Expand All @@ -380,7 +383,9 @@ export class InternalChannel {
}
const localQueue = this.configSelectionQueue;
this.configSelectionQueue = [];
this.callRefTimerUnref();
if (localQueue.length > 0) {
this.callRefTimerUnref();
}
for (const call of localQueue) {
call.reportResolverError(status);
}
Expand Down

0 comments on commit 4dfd8c4

Please sign in to comment.