mirror of https://github.com/grpc/grpc-node.git
Kick the ResolvingLoadBalancer out of IDLE when the first call is started.
This commit is contained in:
parent
e35a7d0a25
commit
887d2ef677
|
@ -261,6 +261,7 @@ export class ChannelImplementation implements Channel {
|
||||||
for (const {callStream, callMetadata} of this.configSelectionQueue) {
|
for (const {callStream, callMetadata} of this.configSelectionQueue) {
|
||||||
this.tryGetConfig(callStream, callMetadata);
|
this.tryGetConfig(callStream, callMetadata);
|
||||||
}
|
}
|
||||||
|
this.configSelectionQueue = [];
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
@ -474,6 +475,11 @@ export class ChannelImplementation implements Channel {
|
||||||
|
|
||||||
private tryGetConfig(stream: Http2CallStream, metadata: Metadata) {
|
private tryGetConfig(stream: Http2CallStream, metadata: Metadata) {
|
||||||
if (this.configSelector === null) {
|
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.callRefTimer.ref?.();
|
||||||
this.configSelectionQueue.push({
|
this.configSelectionQueue.push({
|
||||||
callStream: stream,
|
callStream: stream,
|
||||||
|
|
Loading…
Reference in New Issue