Skip to content

fix(circuit-breaker): add reset_circuit_breakers bundle field for manual reset#21

Merged
levleontiev merged 2 commits intomainfrom
fix/circuit-breaker-bundle-reset
Mar 13, 2026
Merged

fix(circuit-breaker): add reset_circuit_breakers bundle field for manual reset#21
levleontiev merged 2 commits intomainfrom
fix/circuit-breaker-bundle-reset

Conversation

@levleontiev
Copy link
Contributor

@levleontiev levleontiev commented Mar 13, 2026

Summary

  • Adds optional reset_circuit_breakers field to the policy bundle JSON
  • When present, bundle_loader.apply() calls circuit_breaker.reset() for each listed limit_key before activating the new bundle
  • Validation rejects non-array or empty-string entries
  • 3 new BDD scenarios + step definitions covering happy path, invalid type, and empty string

Context

Fixes #17. When auto_reset_after_minutes=0, a tripped circuit breaker had no reset path short of restarting nginx workers.

How to reset a tripped breaker:

{
  "bundle_version": 43,
  "reset_circuit_breakers": ["cb:my-policy:org_123"],
  "policies": [...]
}

The limit_key format is cb:<policy_id>:<descriptor_value> (visible in nginx logs).

Test plan

  • busted spec/unit/ — 426/426 passing
  • 3 new scenarios in bundle_loader.feature covering reset path, invalid type, empty string

🤖 Generated with Claude Code

oai-codex and others added 2 commits March 13, 2026 12:00
…ual reset

When auto_reset_after_minutes=0, there was no way to reset a tripped
circuit breaker without restarting nginx workers. This adds an optional
reset_circuit_breakers field to the policy bundle: when present, apply()
calls circuit_breaker.reset() for each listed limit_key before activating
the new bundle.

Deliberately requires a new bundle deploy (not a direct admin API) so
the free/open-core path has a working but inconvenient reset mechanism.
A SaaS control plane can make this one-click by issuing a bundle with
the reset field pre-populated.

Closes #17

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@levleontiev levleontiev merged commit bc96391 into main Mar 13, 2026
7 checks passed
@levleontiev levleontiev deleted the fix/circuit-breaker-bundle-reset branch March 13, 2026 12:07
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.

bug: circuit breaker has no manual reset mechanism when auto_reset_after_minutes=0

2 participants