Skip to content

v1.0.1

Latest
Compare
Choose a tag to compare
@jameinel jameinel released this 17 Sep 17:51
d9c58a0

What's Changed

This is a small bugfix update from previous versions, though there is one small behavioral change.

The primary fix is that previously if you did ExpBackoff(min=1.0, max=200, factor=2.0, jitter=false), then the times would be in the expected 1.0, 2.0, 4.0. Up to the max. However, when you set jitter=true, while it would preserve the maximum to be the same time as the original backoff, it would pick a random value from 0ms to the max delay, and then truncate that to the minDelay. Which meant that it actually changed the average wait time to something close to 50% of the expected times.

The new logic does a +/- 20% from the expected delay, and then caps that at min and max. This averages very close to the expected values (in testing, the over time difference is around a 1% shift.)

Full Changelog: https://github.com/juju/retry/compare/v1.0.0...v1.0.1## What's Changed

  • fix: cleanup our handling of jitter and other misc by @jameinel in #12