-
Notifications
You must be signed in to change notification settings - Fork 178
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature: retry backoffs #633
Comments
@rueian It's good idea. Maybe later someone want own retry logic. So default retry logic make as you said, but how about make a retrier function like this?
|
@proost sounds good, but the returned 'error' makes the Retrier confusing in terms of its responsibility. How about just return a time.Duration and name the function RetryDelay? |
@rueian Ok, I understand what's your intention. So Let's clear interface. How do you think?
If you agree with definition, I will make a feature. |
Returning an error still seems confusing to me. We can use negative duration to stop retrying. I think returning a duration only is much more clear. One more thing. If the return duration exceeds the context deadline, we should not retry. So there might be some duplications of checking the context deadline in the old isRetryable function and the new RetryDelay that we had better keep in one place. |
@rueian how about this?
I considered it already. so I plan like this:
|
Yes, looks good to me. |
There are about 25
goto retry
statements in rueidis. Such as:rueidis/cluster.go
Lines 460 to 462 in 5135acd
rueidis/client.go
Lines 48 to 50 in 5135acd
rueidis/sentinel.go
Lines 66 to 68 in 5135acd
And so on.
It will be better to add backoffs before ALL these statements to avoid rapid retry storms and those backoffs should have the following properties:
Related to valkey-io/valkey-doc#164
The text was updated successfully, but these errors were encountered: