Skip to content

Commit

Permalink
chore: tests & cleanup of unref?.()
Browse files Browse the repository at this point in the history
  • Loading branch information
AVVS committed Mar 2, 2024
1 parent b873dce commit 62e8ea9
Show file tree
Hide file tree
Showing 8 changed files with 235 additions and 91 deletions.
2 changes: 1 addition & 1 deletion packages/grpc-js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
"@types/lodash": "^4.14.202",
"@types/mocha": "^10.0.6",
"@types/ncp": "^2.0.8",
"@types/node": ">=20.11.20",
"@types/pify": "^5.0.4",
"@types/semver": "^7.5.8",
"@types/node": ">=20.11.20",
"@typescript-eslint/eslint-plugin": "^7.1.0",
"@typescript-eslint/parser": "^7.1.0",
"@typescript-eslint/typescript-estree": "^7.1.0",
Expand Down
3 changes: 2 additions & 1 deletion packages/grpc-js/src/load-balancer-pick-first.ts
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,8 @@ export class PickFirstLoadBalancer implements LoadBalancer {
}
this.connectionDelayTimeout = setTimeout(() => {
this.startNextSubchannelConnecting(subchannelIndex + 1);
}, CONNECTION_DELAY_INTERVAL_MS).unref?.();
}, CONNECTION_DELAY_INTERVAL_MS);
this.connectionDelayTimeout.unref?.();
}

private pickSubchannel(subchannel: SubchannelInterface) {
Expand Down
3 changes: 2 additions & 1 deletion packages/grpc-js/src/resolver-dns.ts
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,8 @@ class DnsResolver implements Resolver {
if (this.continueResolving) {
this.startResolutionWithBackoff();
}
}, this.minTimeBetweenResolutionsMs).unref?.();
}, this.minTimeBetweenResolutionsMs);
this.nextResolutionTimer.unref?.();
this.isNextResolutionTimerRunning = true;
}

Expand Down
1 change: 1 addition & 0 deletions packages/grpc-js/src/resolving-load-balancer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,7 @@ export class ResolvingLoadBalancer implements LoadBalancer {
methodConfig: [],
};
}

this.updateState(ConnectivityState.IDLE, new QueuePicker(this));
this.childLoadBalancer = new ChildLoadBalancerHandler(
{
Expand Down

0 comments on commit 62e8ea9

Please sign in to comment.