You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, tchannel-go/retry.go offers RunWithRetry(runCtx context.Context, f RetriableFunc) which is a straight for loop of the func upto retryOpts.MaxAttempts.
It does not offer a way for callers to specify a backoff strategy.
A backoff strategy (such as backoff.Exponential or backoff.FixedDelay) would be useful to not wreak havoc at an unhealthy backend. The current implementation will shoot 1 + 5 (default retries) calls at the backend.
The proposal is to support a backoff strategy in RetryOptions
// RetryOptions are the retry options used to configure RunWithRetry.typeRetryOptionsstruct {
...TimeoutPerAttempt time.DurationBackoffStrategyBackoffStrategy
}
var defaultRetryOptions = &RetryOptions{
MaxAttempts: 5,
BackoffStrategy : nil // or fixed or backoff
}
If BackoffStrategy is nil, the existing behaviour continues.
If BackoffStrategy is fixed delay, implement a fixed delay between retries
If BackoffStrategy is exponential, implement an exponentially decaying delay exponentially between retries.
The text was updated successfully, but these errors were encountered:
Currently,
tchannel-go/retry.go
offersRunWithRetry(runCtx context.Context, f RetriableFunc)
which is a straight for loop of the func uptoretryOpts.MaxAttempts
.It does not offer a way for callers to specify a backoff strategy.
A backoff strategy (such as
backoff.Exponential
orbackoff.FixedDelay
) would be useful to not wreak havoc at an unhealthy backend. The current implementation will shoot 1 + 5 (default retries) calls at the backend.The proposal is to support a backoff strategy in
RetryOptions
The text was updated successfully, but these errors were encountered: