{"record":{"id":"40d0869830e1cb1c","repo":"App-vNext/Polly","slug":"value-must-be-greater-than-one-40d086","errorCode":null,"errorMessage":"Value must be greater than one.","messagePattern":"Value must be greater than one\\.","errorType":"exception","errorClass":"ArgumentOutOfRangeException","httpStatus":null,"severity":"error","filePath":"src/Polly/CircuitBreaker/AsyncAdvancedCircuitBreakerSyntax.cs","lineNumber":246,"sourceCode":"\n        if (failureThreshold <= 0)\n        {\n            throw new ArgumentOutOfRangeException(nameof(failureThreshold), \"Value must be greater than zero.\");\n        }\n\n        if (failureThreshold > 1)\n        {\n            throw new ArgumentOutOfRangeException(nameof(failureThreshold), \"Value must be less than or equal to one.\");\n        }\n\n        if (samplingDuration < resolutionOfCircuit)\n        {\n            throw new ArgumentOutOfRangeException(nameof(samplingDuration), $\"Value must be equal to or greater than {resolutionOfCircuit.TotalMilliseconds} milliseconds. This is the minimum resolution of the CircuitBreaker timer.\");\n        }\n\n        if (minimumThroughput <= 1)\n        {\n            throw new ArgumentOutOfRangeException(nameof(minimumThroughput), \"Value must be greater than one.\");\n        }\n\n        if (durationOfBreak < TimeSpan.Zero)\n        {\n            throw new ArgumentOutOfRangeException(nameof(durationOfBreak), \"Value must be greater than zero.\");\n        }\n\n        if (onBreak == null)\n        {\n            throw new ArgumentNullException(nameof(onBreak));\n        }\n\n        if (onReset == null)\n        {\n            throw new ArgumentNullException(nameof(onReset));\n        }\n\n        if (onHalfOpen == null)","sourceCodeStart":228,"sourceCodeEnd":264,"githubUrl":"https://github.com/App-vNext/Polly/blob/d0e46bdb1ee11ea50d0e4b6846d2633d6bc09bac/src/Polly/CircuitBreaker/AsyncAdvancedCircuitBreakerSyntax.cs#L228-L264","documentation":"Thrown by the async AdvancedCircuitBreaker syntax when minimumThroughput is <= 1. minimumThroughput must be at least 2 because it is the minimum sample size needed to compute a meaningful failure ratio before tripping. Fires at policy build time.","triggerScenarios":"Calling AdvancedCircuitBreakerAsync(..., minimumThroughput: 1, ...) or 0/negative. The check is `minimumThroughput <= 1`.","commonSituations":"Setting it to 1 expecting 'break on first failure' (use the simple breaker for that), or defaulting to 0 from config.","solutions":["Set minimumThroughput to at least 2 (typically 10+).","For 'break after N failures' semantics, use CircuitBreakerAsync with exceptionsAllowedBeforeBreaking.","Validate config >= 2 at startup."],"exampleFix":"// before\n.AdvancedCircuitBreakerAsync(..., minimumThroughput: 1, ...)\n\n// after\n.AdvancedCircuitBreakerAsync(..., minimumThroughput: 10, ...)","handlingStrategy":"validation","validationCode":"if (minimumThroughput <= 1)\n    throw new ArgumentOutOfRangeException(nameof(minimumThroughput), \"minimumThroughput must be >= 2.\");","typeGuard":"static bool IsValidMinimumThroughput(int n) => n >= 2;","tryCatchPattern":null,"preventionTips":["For 'break after N failures' use the simple CircuitBreakerAsync overload.","Pick minimumThroughput relative to expected traffic in the window.","Validate config >= 2 at startup."],"tags":["circuit-breaker","argument-validation","legacy-api","async","configuration"],"backgroundTag":null,"analyzedSha":"d0e46bdb1ee11ea50d0e4b6846d2633d6bc09bac","analyzedAt":"2026-08-13T16:36:01.959Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}