{"record":{"id":"2d9682813a3e9733","repo":"grpc/grpc-java","slug":"outlier-detection-failure-percentage-threshold-is","errorCode":null,"errorMessage":"outlier_detection failure_percentage_threshold is > 100","messagePattern":"outlier_detection failure_percentage_threshold is > 100","errorType":"validation","errorClass":"ResourceInvalidException","httpStatus":null,"severity":"error","filePath":"xds/src/main/java/io/grpc/xds/XdsClusterResource.java","lineNumber":421,"sourceCode":"    }\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(\n      io.envoyproxy.envoy.extensions.transport_sockets.tls.v3.UpstreamTlsContext upstreamTlsContext,\n      Set<String> certProviderInstances)\n      throws ResourceInvalidException {\n    if (upstreamTlsContext.hasCommonTlsContext()) {\n      validateCommonTlsContext(upstreamTlsContext.getCommonTlsContext(), certProviderInstances,","sourceCodeStart":403,"sourceCodeEnd":439,"githubUrl":"https://github.com/grpc/grpc-java/blob/64daddc1f3d1975670f769f3e97bde8b2ba32d25/xds/src/main/java/io/grpc/xds/XdsClusterResource.java#L403-L439","documentation":"This ResourceInvalidException is thrown when outlier_detection.failure_percentage_threshold exceeds 100. The threshold is a percentage of requests that must fail before failure-percentage outlier detection ejects a host, so values above 100 are meaningless and rejected during Cluster validation in parseNonAggregateCluster.","triggerScenarios":"A Cluster resource carries outlier_detection.failure_percentage_threshold (UInt32Value) with a value > 100 while being validated by validateOutlierDetection.","commonSituations":"Fraction-to-percent conversion mistakes (0.75 -> 750); users entering probabilities; generators reusing a 0-1000 scale; typos like 1005.","solutions":["Set failure_percentage_threshold to a value in [0, 100] (Envoy default is 50).","Scale fractional values by 100 (0.85 -> 85).","Clamp or validate the value in the control plane before publishing.","Keep it below 100 so the detector can actually trigger."],"exampleFix":"# before\noutlier_detection:\n  failure_percentage_threshold: 850\n# after\noutlier_detection:\n  failure_percentage_threshold: 85","handlingStrategy":"validation","validationCode":"boolean validFailurePercentageThreshold(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  cluster = parseCluster(raw);\n} catch (io.grpc.xds.ResourceInvalidException e) {\n  if (e.getMessage().contains(\"failure_percentage_threshold\")) {\n    log.error(\"failure_percentage_threshold must be <= 100\");\n  }\n  return null;\n}","preventionTips":["Scale probabilities by 100 before mapping into failure_percentage_threshold.","Clamp the threshold to [0, 100] at config emission.","Keep a single shared percent-range validator for all outlier_detection percent fields.","Add tests asserting threshold values pass gRPC's xDS validation."],"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"}