Skip to content
Snippets Groups Projects
Commit 67675444 authored by Bojan Marjanovic's avatar Bojan Marjanovic :five: Committed by Bojan Marjanovic
Browse files

Removes circuit_breaker FF

It removes the circuit_breaker feature flag from the code and yml
definition.

Changelog: added
parent cc548b76
No related branches found
No related tags found
1 merge request!121236Removes circuit_breaker feature flag
---
name: circuit_breaker
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/117993
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/409619
milestone: '16.0'
type: ops
group: group::ai-enablement
default_enabled: false
......@@ -22,13 +22,7 @@ def retry_methods_with_exponential_backoff(*method_names)
original_method = instance_method(method_name)
define_method(method_name) do |*args, **kwargs|
if Feature.enabled?(:circuit_breaker, type: :ops)
run_with_circuit do
retry_with_exponential_backoff do
original_method.bind_call(self, *args, **kwargs)
end
end
else
run_with_circuit do
retry_with_exponential_backoff do
original_method.bind_call(self, *args, **kwargs)
end
......@@ -51,9 +45,7 @@ def retry_with_exponential_backoff
http_response = response.response
return if http_response.nil? || http_response.body.blank?
if response.server_error? && Feature.enabled?(:circuit_breaker, type: :ops)
raise Gitlab::Llm::Concerns::CircuitBreaker::InternalServerError
end
raise Gitlab::Llm::Concerns::CircuitBreaker::InternalServerError if response.server_error?
return response unless response.too_many_requests?
......
......@@ -57,20 +57,6 @@ def dummy_method(response_caller)
let(:subject) { service.dummy_method(response_caller) }
end
context 'with feature flag disabled' do
before do
stub_feature_flags(circuit_breaker: false)
end
it 'runs the code block outside of the circuit breaker' do
service = dummy_class.new
subject = service.dummy_method(response_caller)
expect(service).not_to receive(:run_with_circuit)
subject
end
end
describe '.wrap_method' do
it 'wraps the instance method and retries with exponential backoff' do
service = dummy_class.new
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment