Skip to content

fix(breaker): ignore unhandled exceptions - #263

Merged
thomhurst merged 2 commits into
mainfrom
issue-187-breaker-unhandled
Aug 24, 2026
Merged

fix(breaker): ignore unhandled exceptions#263
thomhurst merged 2 commits into
mainfrom
issue-187-breaker-unhandled

Conversation

@thomhurst

Copy link
Copy Markdown
Owner

Summary

  • record only handled failures and genuine successful outcomes in circuit-breaker state
  • leave consecutive and ratio history unchanged for unhandled exceptions
  • release half-open probe admission without closing the circuit when a probe throws an unhandled exception
  • cover normal async, sync, configured-async, ratio, half-open, and deterministic model transitions
  • document that exceptions outside the handling clause do not move breaker state

Validation

  • dotnet build Kevlar.slnx -c Release
  • dotnet run --project tests/Kevlar.Tests -c Release --no-build -- --timeout 5m (849 passed)
  • dotnet run --project tests/Kevlar.IntegrationTests -c Release --no-build -- --timeout 5m (131 passed)
  • deterministic model sweep filter (5 passed)
  • pwsh scripts/Verify-Docs.ps1
  • pwsh scripts/Verify-DocSnippets.ps1 -PackagesPath artifacts/package/release -Version 0.0.0-docs187 (118 snippets; behavior passed)
  • npm ci --prefix docs
  • npm run build --prefix docs

Benchmarks

CircuitBreakerBenchmarks on .NET 10, closed success path:

Path Before After Allocation
ratio breaker 124.7 ns 123.1 ns 0 B → 0 B
async callback configured 145.3 ns 144.3 ns 0 B → 0 B

Depends on #258, whose repair commits are included in this branch.

Closes #187

@coderabbitai

coderabbitai Bot commented Aug 24, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 9a946e5f-4f87-4280-882a-f518a46bdcfc


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Keep coverage instrumentation initialization outside the measured Current-read loop.
@thomhurst
thomhurst force-pushed the issue-187-breaker-unhandled branch from ae3820f to 6918161 Compare August 24, 2026 21:57
@thomhurst
thomhurst merged commit 65e5ec0 into main Aug 24, 2026
9 checks passed
@thomhurst
thomhurst deleted the issue-187-breaker-unhandled branch August 24, 2026 22:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(circuit-breaker): unhandled exceptions must not be recorded as successes

1 participant