mirror of https://github.com/grpc/grpc-node.git
Fix handling of OD policy with no child
This commit is contained in:
parent
b53f5882f1
commit
ed70a0b381
|
@ -113,7 +113,7 @@ export class OutlierDetectionLoadBalancingConfig implements LoadBalancingConfig
|
|||
failurePercentageEjection: Partial<FailurePercentageEjectionConfig> | null,
|
||||
private readonly childPolicy: LoadBalancingConfig[]
|
||||
) {
|
||||
if (childPolicy[0].getLoadBalancerName() === 'pick_first') {
|
||||
if (childPolicy.length > 0 && childPolicy[0].getLoadBalancerName() === 'pick_first') {
|
||||
throw new Error('outlier_detection LB policy cannot have a pick_first child policy');
|
||||
}
|
||||
this.intervalMs = intervalMs ?? 10_000;
|
||||
|
|
Loading…
Reference in New Issue