Skip to content

Use double division to calculate applied jitter in ExponentialBackOff #36943

@sbrannen

Description

@sbrannen

Overview

While reviewing #36932, I noticed that we currently use integer arithmetic when calculating applied jitter values.

For example, with initialInterval = 2000, multiplier = 1.5, and jitter = 100, we currently see applied jitter values of:

  • 100
  • 100
  • 200
  • 300
  • ...

Whereas, with floating-point (double) division, we would rather see:

  • 100
  • 150
  • 225
  • 337
  • ...

In order to avoid the staircase scaling effect that results from our current use of integer division, we should use double division to calculate the applied jitter in applyJitter(long) in ExponentialBackOffExecution.

Related Issues

Metadata

Metadata

Assignees

Labels

in: coreIssues in core modules (aop, beans, core, context, expression)type: enhancementA general enhancement

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions