{"record":{"id":"0bf70fa7e74bcd5c","repo":"grpc/grpc-go","slug":"outlierdetectionloadbalancingconfig-failurepercent","errorCode":null,"errorMessage":"OutlierDetectionLoadBalancingConfig.FailurePercentageEjection.threshold = %v; must be <= 100","messagePattern":"OutlierDetectionLoadBalancingConfig\\.FailurePercentageEjection\\.threshold = (.+?); must be <= 100","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/xds/balancer/outlierdetection/balancer.go","lineNumber":147,"sourceCode":"\t// within +-10000 years. Thus, just check for negative values.\n\tcase lbCfg.Interval < 0:\n\t\treturn nil, fmt.Errorf(\"OutlierDetectionLoadBalancingConfig.interval = %s; must be >= 0\", lbCfg.Interval)\n\tcase lbCfg.BaseEjectionTime < 0:\n\t\treturn nil, fmt.Errorf(\"OutlierDetectionLoadBalancingConfig.base_ejection_time = %s; must be >= 0\", lbCfg.BaseEjectionTime)\n\tcase lbCfg.MaxEjectionTime < 0:\n\t\treturn nil, fmt.Errorf(\"OutlierDetectionLoadBalancingConfig.max_ejection_time = %s; must be >= 0\", lbCfg.MaxEjectionTime)\n\n\t// \"The fields max_ejection_percent,\n\t// success_rate_ejection.enforcement_percentage,\n\t// failure_percentage_ejection.threshold, and\n\t// failure_percentage.enforcement_percentage must have values less than or\n\t// equal to 100.\" - A50\n\tcase lbCfg.MaxEjectionPercent > 100:\n\t\treturn nil, fmt.Errorf(\"OutlierDetectionLoadBalancingConfig.max_ejection_percent = %v; must be <= 100\", lbCfg.MaxEjectionPercent)\n\tcase lbCfg.SuccessRateEjection != nil && lbCfg.SuccessRateEjection.EnforcementPercentage > 100:\n\t\treturn nil, fmt.Errorf(\"OutlierDetectionLoadBalancingConfig.SuccessRateEjection.enforcement_percentage = %v; must be <= 100\", lbCfg.SuccessRateEjection.EnforcementPercentage)\n\tcase lbCfg.FailurePercentageEjection != nil && lbCfg.FailurePercentageEjection.Threshold > 100:\n\t\treturn nil, fmt.Errorf(\"OutlierDetectionLoadBalancingConfig.FailurePercentageEjection.threshold = %v; must be <= 100\", lbCfg.FailurePercentageEjection.Threshold)\n\tcase lbCfg.FailurePercentageEjection != nil && lbCfg.FailurePercentageEjection.EnforcementPercentage > 100:\n\t\treturn nil, fmt.Errorf(\"OutlierDetectionLoadBalancingConfig.FailurePercentageEjection.enforcement_percentage = %v; must be <= 100\", lbCfg.FailurePercentageEjection.EnforcementPercentage)\n\t}\n\treturn lbCfg, nil\n}\n\nfunc (bb) Name() string {\n\treturn Name\n}\n\n// scUpdate wraps a subConn update to be sent to the child balancer.\ntype scUpdate struct {\n\tscw   *subConnWrapper\n\tstate balancer.SubConnState\n}\n\ntype ejectionUpdate struct {\n\tscw       *subConnWrapper","sourceCodeStart":129,"sourceCodeEnd":165,"githubUrl":"https://github.com/grpc/grpc-go/blob/03255a9237b6eb32710f6bc4f2de9a675b99fe36/internal/xds/balancer/outlierdetection/balancer.go#L129-L165","documentation":"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.","triggerScenarios":"ParseConfig gets JSON with a `failurePercentageEjection` object whose `threshold` is > 100. Only checked when the failure_percentage_ejection block is non-nil.","commonSituations":"Operator sets threshold above 100 thinking it disables the check; control-plane scale mismatch (fraction vs percent); misconfigured outlier detection policy.","solutions":["Set `failurePercentageEjection.threshold` to 0-100 (omit the block to disable failure-percentage ejection)","Fix the upstream OutlierDetection failure_percentage_ejection config","Range-check threshold before publishing"],"exampleFix":"// before\n{\"failurePercentageEjection\":{\"threshold\":120}}\n// after\n{\"failurePercentageEjection\":{\"threshold\":85}}","handlingStrategy":"validation","validationCode":"var probe struct{ FPE struct{ Threshold uint32 `json:\"threshold\"` } `json:\"failure_percentage_ejection\"` }\n_ = json.Unmarshal(raw, &probe)\nif probe.FPE.Threshold > 100 {\n    return fmt.Errorf(\"failure_percentage threshold must be <= 100, got %d\", probe.FPE.Threshold)\n}","typeGuard":null,"tryCatchPattern":"lbCfg, err := outlierBB.ParseConfig(raw)\nif err != nil {\n    logger.Warningf(\"rejecting outlier detection config: %v\", err)\n    return fallbackLBConfig\n}","preventionTips":["Keep threshold in 0-100","Validate only when failure_percentage_ejection is present"],"tags":["grpc","xds","outlier-detection","load-balancing","config","go"],"analyzedSha":"03255a9237b6eb32710f6bc4f2de9a675b99fe36","analyzedAt":"2026-08-07T00:29:34.215Z","schemaVersion":2},"datasetVersion":"2026-08-07T03:17:09.362Z"}