grpc/grpc-go · error

OutlierDetectionLoadBalancingConfig.FailurePercentageEjectio

Error message

OutlierDetectionLoadBalancingConfig.FailurePercentageEjection.threshold = %v; must be <= 100

What it means

Returned by outlier detection ParseConfig (internal/xds/balancer/outlierdetection/balancer.go:146) when the optional `failure_percentage_ejection` block is present and its `threshold` exceeds 100. gRFC A50 caps threshold at 100; it is the failure-percentage level above which an endpoint becomes an ejection candidate.

Source

Thrown at internal/xds/balancer/outlierdetection/balancer.go:147

	// within +-10000 years. Thus, just check for negative values.
	case lbCfg.Interval < 0:
		return nil, fmt.Errorf("OutlierDetectionLoadBalancingConfig.interval = %s; must be >= 0", lbCfg.Interval)
	case lbCfg.BaseEjectionTime < 0:
		return nil, fmt.Errorf("OutlierDetectionLoadBalancingConfig.base_ejection_time = %s; must be >= 0", lbCfg.BaseEjectionTime)
	case lbCfg.MaxEjectionTime < 0:
		return nil, fmt.Errorf("OutlierDetectionLoadBalancingConfig.max_ejection_time = %s; must be >= 0", lbCfg.MaxEjectionTime)

	// "The fields max_ejection_percent,
	// success_rate_ejection.enforcement_percentage,
	// failure_percentage_ejection.threshold, and
	// failure_percentage.enforcement_percentage must have values less than or
	// equal to 100." - A50
	case lbCfg.MaxEjectionPercent > 100:
		return nil, fmt.Errorf("OutlierDetectionLoadBalancingConfig.max_ejection_percent = %v; must be <= 100", lbCfg.MaxEjectionPercent)
	case lbCfg.SuccessRateEjection != nil && lbCfg.SuccessRateEjection.EnforcementPercentage > 100:
		return nil, fmt.Errorf("OutlierDetectionLoadBalancingConfig.SuccessRateEjection.enforcement_percentage = %v; must be <= 100", lbCfg.SuccessRateEjection.EnforcementPercentage)
	case lbCfg.FailurePercentageEjection != nil && lbCfg.FailurePercentageEjection.Threshold > 100:
		return nil, fmt.Errorf("OutlierDetectionLoadBalancingConfig.FailurePercentageEjection.threshold = %v; must be <= 100", lbCfg.FailurePercentageEjection.Threshold)
	case lbCfg.FailurePercentageEjection != nil && lbCfg.FailurePercentageEjection.EnforcementPercentage > 100:
		return nil, fmt.Errorf("OutlierDetectionLoadBalancingConfig.FailurePercentageEjection.enforcement_percentage = %v; must be <= 100", lbCfg.FailurePercentageEjection.EnforcementPercentage)
	}
	return lbCfg, nil
}

func (bb) Name() string {
	return Name
}

// scUpdate wraps a subConn update to be sent to the child balancer.
type scUpdate struct {
	scw   *subConnWrapper
	state balancer.SubConnState
}

type ejectionUpdate struct {
	scw       *subConnWrapper

View on GitHub (pinned to 03255a9237)

Solutions

  1. Set `failurePercentageEjection.threshold` to 0-100 (omit the block to disable failure-percentage ejection)
  2. Fix the upstream OutlierDetection failure_percentage_ejection config
  3. Range-check threshold before publishing

Example fix

// before
{"failurePercentageEjection":{"threshold":120}}
// after
{"failurePercentageEjection":{"threshold":85}}
Defensive patterns

Strategy: validation

Validate before calling

var probe struct{ FPE struct{ Threshold uint32 `json:"threshold"` } `json:"failure_percentage_ejection"` }
_ = json.Unmarshal(raw, &probe)
if probe.FPE.Threshold > 100 {
    return fmt.Errorf("failure_percentage threshold must be <= 100, got %d", probe.FPE.Threshold)
}

Try / catch

lbCfg, err := outlierBB.ParseConfig(raw)
if err != nil {
    logger.Warningf("rejecting outlier detection config: %v", err)
    return fallbackLBConfig
}

Prevention

When it happens

Trigger: ParseConfig gets JSON with a `failurePercentageEjection` object whose `threshold` is > 100. Only checked when the failure_percentage_ejection block is non-nil.

Common situations: Operator sets threshold above 100 thinking it disables the check; control-plane scale mismatch (fraction vs percent); misconfigured outlier detection policy.

Related errors


AI-assisted analysis of grpc/grpc-go@03255a9237 (2026-08-07). Data as JSON: /api/errors/0bf70fa7e74bcd5c. Report an issue: GitHub.