Skip to content

Conversation

@maen-bn
Copy link

@maen-bn maen-bn commented Jan 20, 2026

Resolves #8558

@maen-bn maen-bn requested a review from a team as a code owner January 20, 2026 19:48
@maen-bn maen-bn force-pushed the add-jitter-ari-retry-after-header branch from 421c5f7 to b2251a1 Compare January 20, 2026 20:04
factor := 0.2 * (2*rand.Float64() - 1)
jittered := int(float64(base) * (1 + factor))

if jittered < 0 {
Copy link

@nmxhc nmxhc Jan 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi,

I think that this condition should never be met for positive inputs since then jittered>base*0.8>0.
For negative inputs however, this creates an infinite recursion (up to rounding errors for bases close to 0) since jittered<base*0.8<0.

From my understanding of the context, I suggest to remove this branch and adjust the comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add jitter to ARI Retry-After

2 participants