App-vNext/Polly · error · IsolatedCircuitException
The circuit is manually held open and is not allowing calls.
Error message
The circuit is manually held open and is not allowing calls.
What it means
Thrown at execution time (not construction) when a CircuitBreaker is in the Isolated state and a delegate is run through it. Isolation is a manual hold: an operator or code calls circuitController.Isolate() (AdvancedCircuitBreaker manual control) to force the circuit Open and block all traffic for maintenance or incident response. Until Reset() is called, every execution throws IsolatedCircuitException.
Source
Thrown at src/Polly/CircuitBreaker/CircuitStateController.cs:161
}
public void OnActionPreExecute()
{
switch (CircuitState)
{
case CircuitState.Closed:
break;
case CircuitState.HalfOpen:
if (!PermitHalfOpenCircuitTest())
{
throw GetBreakingException();
}
break;
case CircuitState.Open:
throw GetBreakingException();
case CircuitState.Isolated:
throw new IsolatedCircuitException("The circuit is manually held open and is not allowing calls.");
default:
throw new InvalidOperationException("Unhandled CircuitState.");
}
}
public abstract void OnActionSuccess(Context context);
public abstract void OnActionFailure(DelegateResult<TResult> outcome, Context context);
public abstract void OnCircuitReset(Context context);
}
View on GitHub (pinned to d0e46bdb1e)
Solutions
- Call Reset() on the breaker's controller to leave Isolation before executing again.
- If isolation was set by an operator, coordinate the maintenance window so traffic is drained (and probes/health checks account for it) before Reset.
- In tests, dispose or reset the shared breaker instance in a finally/cleanup to avoid state leakage between cases.
Example fix
// before breakerControl.Isolate(); var result = await policy.ExecuteAsync(ct => client.GetAsync(url, ct), cancellationToken); // after // drain traffic / finish maintenance, then: breakerControl.Reset(); var result = await policy.ExecuteAsync(ct => client.GetAsync(url, ct), cancellationToken);
Defensive patterns
Strategy: try-catch
Validate before calling
// before executing, check the controller state if you hold it
if (breakerControl.CircuitState == CircuitState.Isolated)
{
return Result.Unavailable("Downstream manually isolated");
}
return await policy.ExecuteAsync(action, ct); Type guard
bool IsSafeToCall(CircuitState s) => s != CircuitState.Isolated && s != CircuitState.Open;
Try / catch
try { return await policy.ExecuteAsync(action, ct); }
catch (IsolatedCircuitException ex) { log.MaintenanceBlock(ex); return Result.Unavailable(ex.Message); } Prevention
- Drain traffic before calling Isolate(); call Reset() before resuming.
- Expose isolation state through health checks so load balancers stop sending traffic.
- In tests, always Reset() or recreate the breaker in test cleanup.
When it happens
Trigger: Calling an action through a breaker whose controller has been put into Isolated mode via the manual isolate API, then executing any delegate before calling Reset. This is runtime behavior of CircuitStateController when CurrentState == CircuitState.Isolated.
Common situations: A maintenance job or admin endpoint isolates a downstream-dependency breaker and the application keeps serving requests; tests that isolate a breaker and forget to reset it leak the state into subsequent test cases; a graceful-shutdown hook isolates a breaker but liveness probes still route traffic.
Related errors
- Value must be greater than zero.
- This instance of 'CircuitBreakerStateProvider' is already in
- Value cannot be null.
- Value cannot be null. (Parameter 'cacheProvider')
- Value cannot be null. (Parameter 'cacheKeyStrategy')
AI-assisted analysis of App-vNext/Polly@d0e46bdb1e (2026-08-13).
Data as JSON: /api/errors/fda01248cb834731.
Report an issue: GitHub.