Repository navigation
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
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.
Important
Proposal only. This draft makes a client-side circuit-breaker direction concrete for owner review. It does not enable any consumer or commit the owning team to this API, policy, or rollout.
Summary
Adds an opt-in transport circuit-breaker seam to
Freno::Client. This can stop repeated Freno connection attempts locally during dependency outages.The proposal follows the github/traffic-alerts#20837 reconnect-storm investigation, where unavailable Freno backends caused tens of millions of short-lived connection attempts and high GLB CPU.
GitHub Copilot produced this implementation draft from that investigation. The owning team has not reviewed or endorsed it.
Proposed direction
enable_transport_circuit_breaker(circuit_breaker:)accepts an existing object implementingallow_request?,success, andfailure; behavior remains unchanged without it.raise_on_timeout: falseand raises a typedFreno::Errorwhen timeout errors are enabled.Freno::Clientper endpoint. Configure all other Faraday middleware first, then enable the breaker before the connection's first request.The caller owns breaker construction, policy, instrumentation, force modes, and state scope. The gem adds no breaker dependency or Freno-specific threshold configuration.
Ownership and scope
The submitter is offering this as a concrete direction from the incident investigation, not volunteering to own the final API, rollout, consumer adoption, or ongoing maintenance. Repository owners may take it over, reshape it, reimplement it, or close it.
No consumer is enabled by this draft. If owners pursue it, they would still need to select the breaker implementation and policy, decide whether to start in observe-only mode, choose initial consumers, and own rollout and rollback.
Integration constraints
Freno::FailOpenClientintentionally converts failures into an allowed result. It can convert both a raised circuit rejection and the failed timeout result returned withraise_on_timeout: false.Freno::Throttlerbreaker represent different operations. Applications must use separate stateful breaker instances and policies, or enable only one seam.Validation
The default and Faraday 0/1/2 suites each pass with 69 tests and 239 assertions, including retries, validators, nested requests, invalid statuses, disabled behavior, and concurrent mixed outcomes. Full RuboCop and diff checks pass.
CI pins Ubuntu 24.04 so the supported Ruby 3.0 and 3.1 matrix remains available.
Related