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 AdvancedCircuitBreakerAsync<T> syntax when minimumThroughput is <= 1. It must be >= 2 because it is the minimum sample count needed before the circuit can trip on a failure ratio. Fires at policy construction.

Source

Thrown at src/Polly/CircuitBreaker/AsyncAdvancedCircuitBreakerTResultSyntax.cs:236

        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 (commonly 10+).
  2. For 'break after N events' semantics use CircuitBreakerAsync<T> with handledEventsAllowedBeforeBreaking.
  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: Using 1 expecting 'trip on first failure' semantics (use the simple breaker instead), or a 0 default from config.

Related errors


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