-
Notifications
You must be signed in to change notification settings - Fork 839
Unify four backoff implementations #615
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
Conversation
pkg/util/backoff.go
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please write godoc for all of these public types & methods.
pkg/util/backoff.go
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only minor comment: everywhere this is it used, the meaning is inverted (we're asking NotFinished). Perhaps inverting this function would make a slightly nicer interface? Call it Remaining or something?
tomwilkie
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM modulo one nit.
ec114e1 to
4ad4700
Compare
4ad4700 to
e89dcff
Compare
|
I went with |
| RequireConsistent: true, | ||
| WaitIndex: index, | ||
| WaitTime: c.longPollDuration, | ||
| }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder is Ongoing should check if done is closed, and then replace the call to isClosed here with a call to Ongoing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From the Context docs we would check Err() != nil
That would change the semantics; probably in an ok way, but I felt this was conflating the two mechanisms too much and we should check explicitly in the outer loop.
I have another PR under way where I'm doing that. Maybe I'll change my mind.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, that comment didn't make very much sense in this context. See #618 for what I meant.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
:-) Thanks Brian. I'll try and look at that tomorrow, but I'm flying then, so may be a little delayed.
|
Nice. On question, definitely not very important. Feel free to address or not, no need for another review. |
Fixes #609
As an added bonus the wait in
aws_storage_clientends early if theContextis cancelled.