Closed stevvooe closed 8 years ago
Not related to this PR specifically: I was looking at RetryingSink.Write
for context, and saw that it it creates a new timer when Proceed
returns, waits for that timer to fire, and then resets it before the next time it's used. It would be slightly simpler to use <-time.After(backoff)
in the select
statement. Then there would be no need to manager the lifecycle of a timer object.
LGTM. Noted minor nits.
I was looking at RetryingSink.Write for context, and saw that it it creates a new timer when Proceed returns, waits for that timer to fire, and then resets it before the next time it's used. It would be slightly simpler to use <-time.After(backoff) in the select statement. Then there would be no need to manager the lifecycle of a timer object.
Thanks. Now this one needs a simple rebase.
To complement circuit breaker, we now have an exponential backoff retry strategy. The common increasing bound strategy is implemented.
A small bug was exposed in the implementation that blocked the retry forever if the strategy did not probe. Now, we simply wait for the retry and proceed. This may change behavior in the breaker case, but is more correct.
Signed-off-by: Stephen J Day stephen.day@docker.com
cc @diogomonica @aluzzardi @aaronlehmann