mirror of
https://github.com/spring-projects/spring-framework.git
synced 2026-09-27 17:49:02 +00:00
When an ExponentialBackOff is configured with an initialInterval of 0 and a positive jitter, the first nextBackOff() evaluated (jitter * (interval / initialInterval)) performs integer division by zero and throws an ArithmeticException. Both initialInterval = 0 and jitter > 0 are individually accepted configurations -- with jitter = 0, an initialInterval of 0 already yields a delay of 0 -- so the combination should not throw. This commit addresses that by guarding the division so that no jitter scaling is applied when initialInterval is 0, leaving the behavior for positive intervals unchanged. Closes gh-36932 Signed-off-by: junhyeong9812 <pickjog@gmail.com>