Kick the ResolvingLoadBalancer out of IDLE when the first call is started.

This commit is contained in:
Michael Lumish 2021-02-02 14:16:10 -08:00
parent e35a7d0a25
commit 887d2ef677
1 changed files with 6 additions and 0 deletions

View File

@ -261,6 +261,7 @@ export class ChannelImplementation implements Channel {
for (const {callStream, callMetadata} of this.configSelectionQueue) {
this.tryGetConfig(callStream, callMetadata);
}
this.configSelectionQueue = [];
});
}
);
@ -474,6 +475,11 @@ export class ChannelImplementation implements Channel {
private tryGetConfig(stream: Http2CallStream, metadata: Metadata) {
if (this.configSelector === null) {
/* This branch will only be taken at the beginning of the channel's life,
* before the resolver ever returns a result. So, the
* ResolvingLoadBalancer may be idle and if so it needs to be kicked
* because it now has a pending request. */
this.resolvingLoadBalancer.exitIdle();
this.callRefTimer.ref?.();
this.configSelectionQueue.push({
callStream: stream,