backoff documentation error
jsw opened this issue · comments
Jeff White commented
README
max(try * 2 ^ time_unit, 1) * jitter
Retry.scala
val jitter = 0.5 + rng.nextFloat()
val k = (math.max(1, 2 ^ tries - 1) * jitter).toInt
backOffUnit * k
Are these equivalent?
Johan Andrén commented
Good catch, they are not equivalent. Probably a first idea documented vs what it actually turned up to be. Additionally there is a bug in there as ^
is bitwise XOR and not pow
.