{"record":{"id":"4d277d7c885d44ce","repo":"App-vNext/Polly","slug":"value-must-be-equal-to-or-greater-than-resolution-4d277d","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/AsyncAdvancedCircuitBreakerSyntax.cs","lineNumber":241,"sourceCode":"        TimeSpan durationOfBreak,\n        Action<Exception, CircuitState, TimeSpan, Context> onBreak,\n        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":223,"sourceCodeEnd":259,"githubUrl":"https://github.com/App-vNext/Polly/blob/d0e46bdb1ee11ea50d0e4b6846d2633d6bc09bac/src/Polly/CircuitBreaker/AsyncAdvancedCircuitBreakerSyntax.cs#L223-L259","documentation":"Thrown by the async AdvancedCircuitBreaker syntax when samplingDuration is below the 20ms minimum timer resolution. The advanced breaker subdivides the sampling window, so it cannot run below ResolutionOfCircuitTimer (20ms). Fires at construction.","triggerScenarios":"Calling AdvancedCircuitBreakerAsync(..., samplingDuration: TimeSpan.FromMilliseconds(1), ...) or TimeSpan.Zero. The check is `samplingDuration < resolutionOfCircuit` (resolutionOfCircuit = 20ms).","commonSituations":"Supplying TimeSpan.Zero as placeholder, misconfigured units, or a 0/default from config.","solutions":["Use a samplingDuration >= 20ms; prefer seconds-scale windows for real traffic.","Validate the configured duration against TimeSpan.FromMilliseconds(20) before building.","Double-check config units (seconds vs milliseconds)."],"exampleFix":"// before\n.AdvancedCircuitBreakerAsync(..., samplingDuration: TimeSpan.Zero, ...)\n\n// after\n.AdvancedCircuitBreakerAsync(..., samplingDuration: TimeSpan.FromSeconds(15), ...)","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":["Confirm config units match the API (seconds vs milliseconds).","Avoid TimeSpan.Zero as a placeholder.","Use seconds-scale windows in production."],"tags":["circuit-breaker","argument-validation","legacy-api","async","time-configuration"],"backgroundTag":null,"analyzedSha":"d0e46bdb1ee11ea50d0e4b6846d2633d6bc09bac","analyzedAt":"2026-08-13T16:36:01.959Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}