Repository navigation
Require stable Freno recovery - #37
Open
pradeepkintali wants to merge 4 commits into
Open
pradeepkintali wants to merge 4 commits into
pradeepkintali wants to merge 4 commits into
Conversation
After a rejection, require consecutive healthy checks before releasing work and keep normal sustained throttling out of the circuit breaker failure path. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 0fbc396f-32f9-449a-8537-6264e8665c31
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 0fbc396f-32f9-449a-8537-6264e8665c31
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Documentation remains contradictory, and the configurable recovery threshold lacks behavioral coverage.
Review effort: Balanced
Findings: 4
Open (4)
What changed in this PR
Adds stable Freno recovery while preserving the healthy fast path.
Changes:
- Requires consecutive healthy checks after throttling.
- Updates circuit-breaker and recovery instrumentation behavior.
- Adds validation, tests, documentation, and minor style cleanups.
| File | Description |
|---|---|
lib/freno/throttler.rb |
Implements stable recovery and instrumentation. |
test/freno/throttler_test.rb |
Tests recovery and circuit-breaker behavior. |
README.md |
Documents the new configuration and semantics. |
lib/freno/client.rb |
Simplifies range syntax. |
lib/freno/client/errors.rb |
Expands the error class declaration. |
lib/freno/client/preconditions.rb |
Expands the precondition error declaration. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Correct the documented configuration and circuit-breaker behavior, clarify instrumentation semantics, and cover non-default recovery thresholds. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 0fbc396f-32f9-449a-8537-6264e8665c31
UyumazHakan
approved these changes
Sep 30, 2026
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: dea961fa-5766-415f-a0f5-2562c55a0385
andyedison
approved these changes
Oct 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
stable_recovery: falseas an explicit, default-off rollout switch.for existing callers when upgrading the gem.
stable_recovery: true, retain the initially healthy fast path, butrequire three consecutive passing checks after rejection. Another rejection
resets recovery progress.
WaitedTooLongas normal sustained throttling,rather than a circuit-breaker failure. Transport/decision errors still fail
the circuit breaker in both modes.
Rollout and rollback
Wire
stable_recoveryto the consuming application's feature switch. This gemdoes not automatically discover an application feature-flag service.
The companion server/Puppet rollout uses a 30-second recovery window, whereas
existing client
max_wait_secondsdefaults to 10. Keep the existing default;approve a larger budget only for appropriate workloads.
transport errors, protected work throughput, retries, and backlog.
Set
stable_recovery: falseto restore both legacy release and timeoutcircuit-breaker behavior. Setting only
required_consecutive_successes: 1does not restore the latter. A package-version rollback remains available.
Recovery progress is local to each
throttlecall.Server-side required dependencies are independently gated by configuration in
github/freno#196 and the initially empty enforcement allowlist in
github/puppet#44086. Never bypass protection merely because a wait budget expires.
Validation
October 15 local validation, using Ruby 3.3 in an isolated container:
bundle exec rake test: 46 runs, 181 assertions, 0 failures/errors/skips.bundle exec rubocop lib/freno/throttler.rb test/freno/throttler_test.rb: no offenses.circuit accounting, and boolean switch validation. Existing stable-recovery
tests now opt in explicitly.
git diff --checkpassed.