yoshuawuyts / exponential-backoff

Exponential backoff generator with jitter.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Overflow error with u32::MAX retries

tonycdot opened this issue · comments

In the system that should has no retries boundary using the std::u32::MAX for number of retries is intuitive.
The problem is retries increment in iter::Iterator for Iter implementation which results in overflow error.
The problem really resolves using std::u32::MAX - 1, but I suggest to use saturating add when incrementing.