Skip to content

Commit 62e8ea9

Browse files
committed
chore: tests & cleanup of unref?.()
1 parent b873dce commit 62e8ea9

File tree

8 files changed

+235
-91
lines changed

8 files changed

+235
-91
lines changed

packages/grpc-js/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@
2020
"@types/lodash": "^4.14.202",
2121
"@types/mocha": "^10.0.6",
2222
"@types/ncp": "^2.0.8",
23+
"@types/node": ">=20.11.20",
2324
"@types/pify": "^5.0.4",
2425
"@types/semver": "^7.5.8",
25-
"@types/node": ">=20.11.20",
2626
"@typescript-eslint/eslint-plugin": "^7.1.0",
2727
"@typescript-eslint/parser": "^7.1.0",
2828
"@typescript-eslint/typescript-estree": "^7.1.0",

packages/grpc-js/src/load-balancer-pick-first.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,8 @@ export class PickFirstLoadBalancer implements LoadBalancer {
415415
}
416416
this.connectionDelayTimeout = setTimeout(() => {
417417
this.startNextSubchannelConnecting(subchannelIndex + 1);
418-
}, CONNECTION_DELAY_INTERVAL_MS).unref?.();
418+
}, CONNECTION_DELAY_INTERVAL_MS);
419+
this.connectionDelayTimeout.unref?.();
419420
}
420421

421422
private pickSubchannel(subchannel: SubchannelInterface) {

packages/grpc-js/src/resolver-dns.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,8 @@ class DnsResolver implements Resolver {
309309
if (this.continueResolving) {
310310
this.startResolutionWithBackoff();
311311
}
312-
}, this.minTimeBetweenResolutionsMs).unref?.();
312+
}, this.minTimeBetweenResolutionsMs);
313+
this.nextResolutionTimer.unref?.();
313314
this.isNextResolutionTimerRunning = true;
314315
}
315316

packages/grpc-js/src/resolving-load-balancer.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,7 @@ export class ResolvingLoadBalancer implements LoadBalancer {
212212
methodConfig: [],
213213
};
214214
}
215+
215216
this.updateState(ConnectivityState.IDLE, new QueuePicker(this));
216217
this.childLoadBalancer = new ChildLoadBalancerHandler(
217218
{

0 commit comments

Comments
 (0)