-
Notifications
You must be signed in to change notification settings - Fork 185
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
Give reason for Stop #97
Comments
I'm sorry, I can't think of a solution without changing the API. |
We just reverted NextBackOff function so that it does not "predict" if there are no more retries and returns Stop only after ctx.Err is set to DeadlineExceeded. I agree having NextBackoffError() might be a good option. |
@praran26 Sure, but I don't think that's a good long-term solution. It's a good feature to have. How do you think we can square NextBackOffError with the interface? |
Just an idea: Backoff can optionally implement |
Hey,
I just pulled a newer version of backoff into some internal things, importing among others this patch: 62661b4
Problem is that now it's impossible for the user to tell if we stopped because of a DeadlineExceeded versus other reasons. Got any ideas how to deal with that? I don't like changing the API, because most people probably compare against
backoff.Stop
, but I'm not sure what else to do.Perhaps an alternative
NextBackOff
method that can returnStop
orDeadlineStop
?Or
NextBackOffError() (time.Duration, error)
that can return a context.DeadlineExceeded?Any ideas?
Thanks
The text was updated successfully, but these errors were encountered: