{"record":{"id":"cd13a2a0e05ea207","repo":"grpc/grpc-java","slug":"outlier-detection-enforcing-success-rate-is-100","errorCode":null,"errorMessage":"outlier_detection enforcing_success_rate is > 100","messagePattern":"outlier_detection enforcing_success_rate is > 100","errorType":"validation","errorClass":"ResourceInvalidException","httpStatus":null,"severity":"error","filePath":"xds/src/main/java/io/grpc/xds/XdsClusterResource.java","lineNumber":416,"sourceCode":"      }\n      if (hasNegativeValues(outlierDetection.getMaxEjectionTime())) {\n        throw new ResourceInvalidException(\n            \"outlier_detection max_ejection_time has a negative value\");\n      }\n    }\n    if (outlierDetection.hasMaxEjectionPercent()\n        && outlierDetection.getMaxEjectionPercent().getValue() > 100) {\n      throw new ResourceInvalidException(\n          \"outlier_detection max_ejection_percent is > 100\");\n    }\n    if (outlierDetection.hasEnforcingSuccessRate()\n        && outlierDetection.getEnforcingSuccessRate().getValue() > 100) {\n      throw new ResourceInvalidException(\n          \"outlier_detection enforcing_success_rate is > 100\");\n    }\n    if (outlierDetection.hasFailurePercentageThreshold()\n        && outlierDetection.getFailurePercentageThreshold().getValue() > 100) {\n      throw new ResourceInvalidException(\n          \"outlier_detection failure_percentage_threshold is > 100\");\n    }\n    if (outlierDetection.hasEnforcingFailurePercentage()\n        && outlierDetection.getEnforcingFailurePercentage().getValue() > 100) {\n      throw new ResourceInvalidException(\n          \"outlier_detection enforcing_failure_percentage is > 100\");\n    }\n\n    return outlierDetection;\n  }\n\n  static boolean hasNegativeValues(Duration duration) {\n    return duration.getSeconds() < 0 || duration.getNanos() < 0;\n  }\n\n  @VisibleForTesting\n  static io.envoyproxy.envoy.extensions.transport_sockets.tls.v3.UpstreamTlsContext\n      validateUpstreamTlsContext(","sourceCodeStart":398,"sourceCodeEnd":434,"githubUrl":"https://github.com/grpc/grpc-java/blob/64daddc1f3d1975670f769f3e97bde8b2ba32d25/xds/src/main/java/io/grpc/xds/XdsClusterResource.java#L398-L434","documentation":"validateOutlierDetection throws this ResourceInvalidException when outlier_detection.enforcing_success_rate is greater than 100. This field is a percentage controlling how strongly success-rate outlier detection ejects hosts, so it must be within [0, 100]. An out-of-range value invalidates the whole Cluster resource.","triggerScenarios":"A Cluster resource parsed by parseNonAggregateCluster contains outlier_detection.enforcing_success_rate (a UInt32Value) with a value > 100, e.g. 1000 from a fraction mis-scaled by 1000x.","commonSituations":"Sending probability-style values (0.0-1.0) scaled incorrectly; user-supplied dashboard input forwarded without clamping; copy-paste errors between percentage and per-ten-thousand (basis-point) fields like enforcing_success_rate_local_host_default in Envoy.","solutions":["Set enforcing_success_rate to a percentage in [0, 100] (Envoy default is 50).","Convert per-ten-thousand values (e.g. 5000) to percent (50) before sending.","Clamp the value server-side to 0..100 at config generation.","Audit templates for basis-point vs percent mixing."],"exampleFix":"# before (basis points)\noutlier_detection:\n  enforcing_success_rate: 5000\n# after (percent)\noutlier_detection:\n  enforcing_success_rate: 50","handlingStrategy":"validation","validationCode":"boolean validEnforcingSuccessRate(io.envoyproxy.envoy.type.v3.UInt32Value v) {\n  return v == null || v.getValue() <= 100;\n}","typeGuard":"boolean isPercent(long v) {\n  return v >= 0 && v <= 100;\n}","tryCatchPattern":"try {\n  parseCluster(resource);\n} catch (io.grpc.xds.ResourceInvalidException e) {\n  if (e.getMessage().contains(\"enforcing_success_rate\")) {\n    log.error(\"enforcing_success_rate must be <= 100 (percent scale)\");\n  }\n  return null;\n}","preventionTips":["Keep all enforcing_* outlier fields on a 0-100 percent scale.","Convert Envoy per-ten-thousand values (x/10000) to percent before sending to gRPC xDS.","Clamp values to [0, 100] in the control plane.","Document the scale next to every percentage field in your config templates."],"tags":["xds","grpc","config-validation","range-check"],"backgroundTag":"value-out-of-range","analyzedSha":"64daddc1f3d1975670f769f3e97bde8b2ba32d25","analyzedAt":"2026-09-08T06:14:57.704Z","contentChangedAt":"2026-09-08T06:14:57.704Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}