Relay Retry Backoff Treats Maximum Delay as a Minimum
Level 2 · node · Reliability · Exponential backoff uses the maximum delay as a floor instead of a cap
Scenario
A fictional relay service calculates how long to wait before retrying a failed delivery at each site. The first wait equals the configured base delay, and subsequent waits double, but must never exceed the configured maximum. The current implementation waits too long even on the first retry and can exceed the maximum later. Inspect the repository, policy service, and controller.
Requirements
Correct the exponential backoff delay for attempt numbers starting at one, enforcing the maximum delay. Preserve per-site policies, rejection of invalid policies or attempt numbers, and behavior for unknown sites.
Acceptance criteria
- The first retry uses the configured base delay.
- Before reaching the cap, retry delays double on each attempt.
- Even for later retries, the delay never exceeds the configured maximum.
- Different sites use their own independent retry policies.
- Invalid policies and attempt numbers are rejected, and unknown sites return no delay.