From 5be024f060a7cc7377167aabde95e3aefd54fd87 Mon Sep 17 00:00:00 2001 From: Michael Lumish Date: Mon, 18 Sep 2023 17:32:29 -0700 Subject: [PATCH] grpc-js: Delegate to child picker in ResolvingLoadBalancer#updateResolution --- packages/grpc-js/src/resolving-load-balancer.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/grpc-js/src/resolving-load-balancer.ts b/packages/grpc-js/src/resolving-load-balancer.ts index e600047e8..3f52093a1 100644 --- a/packages/grpc-js/src/resolving-load-balancer.ts +++ b/packages/grpc-js/src/resolving-load-balancer.ts @@ -264,7 +264,11 @@ export class ResolvingLoadBalancer implements LoadBalancer { private updateResolution() { this.innerResolver.updateResolution(); if (this.currentState === ConnectivityState.IDLE) { - this.updateState(ConnectivityState.CONNECTING, new QueuePicker(this)); + /* this.latestChildPicker is initialized as new QueuePicker(this), which + * is an appropriate value here if the child LB policy is unset. + * Otherwise, we want to delegate to the child here, in case that + * triggers something. */ + this.updateState(ConnectivityState.CONNECTING, this.latestChildPicker); } this.backoffTimeout.runOnce(); }