{"record":{"id":"fffb1ba16c53028c","repo":"App-vNext/Polly","slug":"value-must-be-equal-to-or-greater-than-resolution-fffb1b","errorCode":null,"errorMessage":"Value must be equal to or greater than {resolutionOfCircuit.TotalMilliseconds} milliseconds. This is the minimum resolution of the CircuitBreaker timer.","messagePattern":"Value must be equal to or greater than (.+?) milliseconds\\. This is the minimum resolution of the CircuitBreaker timer\\.","errorType":"exception","errorClass":"ArgumentOutOfRangeException","httpStatus":null,"severity":"error","filePath":"src/Polly/CircuitBreaker/AsyncAdvancedCircuitBreakerTResultSyntax.cs","lineNumber":231,"sourceCode":"    /// <exception cref=\"ArgumentNullException\">Thrown when <paramref name=\"onReset\"/> is <see langword=\"null\"/>.</exception>\n    /// <exception cref=\"ArgumentNullException\">Thrown when <paramref name=\"onHalfOpen\"/> is <see langword=\"null\"/>.</exception>\n    public static AsyncCircuitBreakerPolicy<TResult> AdvancedCircuitBreakerAsync<TResult>(this PolicyBuilder<TResult> policyBuilder, double failureThreshold, TimeSpan samplingDuration, int minimumThroughput, TimeSpan durationOfBreak, Action<DelegateResult<TResult>, CircuitState, TimeSpan, Context> onBreak, Action<Context> onReset, Action onHalfOpen)\n    {\n        var resolutionOfCircuit = TimeSpan.FromTicks(AdvancedCircuitController<EmptyStruct>.ResolutionOfCircuitTimer);\n\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)","sourceCodeStart":213,"sourceCodeEnd":249,"githubUrl":"https://github.com/App-vNext/Polly/blob/d0e46bdb1ee11ea50d0e4b6846d2633d6bc09bac/src/Polly/CircuitBreaker/AsyncAdvancedCircuitBreakerTResultSyntax.cs#L213-L249","documentation":"Thrown by the async AdvancedCircuitBreakerAsync<T> syntax when samplingDuration is below the 20ms minimum timer resolution. The advanced circuit needs windows of at least ResolutionOfCircuitTimer (20ms). Fires at policy construction.","triggerScenarios":"Calling AdvancedCircuitBreakerAsync(..., samplingDuration: TimeSpan.FromMilliseconds(10), ...) or TimeSpan.Zero. The check is `samplingDuration < resolutionOfCircuit` (20ms).","commonSituations":"TimeSpan.Zero placeholder, wrong config units, or a 0/default value from config.","solutions":["Use a samplingDuration of at least 20ms (prefer seconds-scale windows).","Validate the duration against TimeSpan.FromMilliseconds(20) before building.","Confirm config units match what the API expects."],"exampleFix":"// before\n.AdvancedCircuitBreakerAsync(..., samplingDuration: TimeSpan.FromMilliseconds(10), ...)\n\n// after\n.AdvancedCircuitBreakerAsync(..., samplingDuration: TimeSpan.FromSeconds(10), ...)","handlingStrategy":"validation","validationCode":"if (samplingDuration < TimeSpan.FromMilliseconds(20))\n    throw new ArgumentOutOfRangeException(nameof(samplingDuration), \"samplingDuration must be >= 20ms.\");","typeGuard":"static bool IsValidSamplingDuration(TimeSpan d) => d >= TimeSpan.FromMilliseconds(20);","tryCatchPattern":null,"preventionTips":["Double-check config units before binding.","Never use TimeSpan.Zero as a placeholder.","Prefer seconds-scale sampling windows."],"tags":["circuit-breaker","argument-validation","legacy-api","async","generic-result","time-configuration"],"backgroundTag":null,"analyzedSha":"d0e46bdb1ee11ea50d0e4b6846d2633d6bc09bac","analyzedAt":"2026-08-13T16:36:01.959Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}