[#339] pool/tree: Configure circuit breaker parameters
Some checks failed
Code generation / Generate proto (pull_request) Successful in 29s
DCO / DCO (pull_request) Successful in 32s
Tests and linters / Lint (pull_request) Failing after 42s
Tests and linters / Tests (pull_request) Successful in 42s

Signed-off-by: Alex Vanin <a.vanin@yadro.com>
This commit is contained in:
Alexey Vanin 2025-03-04 14:49:07 +03:00
parent 06ef257ddc
commit d592bb931e

View file

@ -376,6 +376,18 @@ func (x *InitParameters) SetNetMapInfoSource(netMapInfoSource NetMapInfoSource)
x.netMapInfoSource = netMapInfoSource
}
// SetCircuitBreakerThreshold sets number of consecutive failed connection before
// circuit is considered closed and therefore return error immediately.
func (x *InitParameters) SetCircuitBreakerThreshold(circuitBreakerThreshold int) {
x.circuitBreakerThreshold = circuitBreakerThreshold
}
// SetCircuitBreakerDuration sets duration for circuit to be considered closed.
// This effectively limits to one new connection try per duration.
func (x *InitParameters) SetCircuitBreakerDuration(circuitBreakerDuration time.Duration) {
x.circuitBreakerDuration = circuitBreakerDuration
}
// GetNodes invokes eponymous method from TreeServiceClient.
//
// Can return predefined errors: