App-vNext/Polly · error · ArgumentOutOfRangeException

Value must be greater than one.

Error message

Value must be greater than one.

What it means

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.

Source

Thrown at src/Polly/CircuitBreaker/AsyncAdvancedCircuitBreakerSyntax.cs:246

        if (failureThreshold <= 0)
        {
            throw new ArgumentOutOfRangeException(nameof(failureThreshold), "Value must be greater than zero.");
        }

        if (failureThreshold > 1)
        {
            throw new ArgumentOutOfRangeException(nameof(failureThreshold), "Value must be less than or equal to one.");
        }

        if (samplingDuration < resolutionOfCircuit)
        {
            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.");
        }

        if (minimumThroughput <= 1)
        {
            throw new ArgumentOutOfRangeException(nameof(minimumThroughput), "Value must be greater than one.");
        }

        if (durationOfBreak < TimeSpan.Zero)
        {
            throw new ArgumentOutOfRangeException(nameof(durationOfBreak), "Value must be greater than zero.");
        }

        if (onBreak == null)
        {
            throw new ArgumentNullException(nameof(onBreak));
        }

        if (onReset == null)
        {
            throw new ArgumentNullException(nameof(onReset));
        }

        if (onHalfOpen == null)

View on GitHub (pinned to d0e46bdb1e)

Solutions

  1. Set minimumThroughput to at least 2 (typically 10+).
  2. For 'break after N failures' semantics, use CircuitBreakerAsync with exceptionsAllowedBeforeBreaking.
  3. Validate config >= 2 at startup.

Example fix

// before
.AdvancedCircuitBreakerAsync(..., minimumThroughput: 1, ...)

// after
.AdvancedCircuitBreakerAsync(..., minimumThroughput: 10, ...)
Defensive patterns

Strategy: validation

Validate before calling

if (minimumThroughput <= 1)
    throw new ArgumentOutOfRangeException(nameof(minimumThroughput), "minimumThroughput must be >= 2.");

Type guard

static bool IsValidMinimumThroughput(int n) => n >= 2;

Prevention

When it happens

Trigger: Calling AdvancedCircuitBreakerAsync(..., minimumThroughput: 1, ...) or 0/negative. The check is `minimumThroughput <= 1`.

Common situations: Setting it to 1 expecting 'break on first failure' (use the simple breaker for that), or defaulting to 0 from config.

Related errors


AI-assisted analysis of App-vNext/Polly@d0e46bdb1e (2026-08-13). Data as JSON: /api/errors/40d0869830e1cb1c. Report an issue: GitHub.