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
{{ message }}
This repository has been archived by the owner on Nov 11, 2024. It is now read-only.
Here b.NextBackoff() returns the ExponentialBackoff.Stop value but it's being compared against the package constant Stop (defined as -1)
I'm not sure why you'd ever want to change this value (so perhaps it shouldn't have been an exported member?) but I think this needs changing to either:
Compare b.NextBackoff() against whatever ExponentialBackoff.Stop is set to
Do some initialising logic so that ExponentialBackoff.Stop is always set to a sensible value
The text was updated successfully, but these errors were encountered:
As far as I know usage of NewExponentialBackOff will ensure that ExponentialBackoff.Stop is always set to a sensible value as you want. So I'm not sure there is anything to be done here.
Oh yeah entirely my mistake for initialising the struct myself rather than using the constructor. Would be nice to guard against this though, as the effects are pretty bad! (rather than running the function with a graceful backoff, run it repeatedly with no delay 😬)
If
ExponentialBackoff.Stop
is zero (e.g. if you forget to initialise it) then the backoff function can run into an infinite loop on this line:backoff/retry.go
Line 98 in a04a6fe
Here
b.NextBackoff()
returns theExponentialBackoff.Stop
value but it's being compared against the package constantStop
(defined as-1
)I'm not sure why you'd ever want to change this value (so perhaps it shouldn't have been an exported member?) but I think this needs changing to either:
b.NextBackoff()
against whateverExponentialBackoff.Stop
is set toExponentialBackoff.Stop
is always set to a sensible valueThe text was updated successfully, but these errors were encountered: