Skip to content

Commit

Permalink
strea.go: update comment
Browse files Browse the repository at this point in the history
  • Loading branch information
isgj committed Nov 25, 2024
1 parent df8dd0d commit 81ae30b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion stream.go
Original file line number Diff line number Diff line change
Expand Up @@ -709,7 +709,7 @@ func (a *csAttempt) shouldRetry(err error) (bool, error) {
} else {
fact := math.Pow(rp.BackoffMultiplier, float64(cs.numRetriesSincePushback))
cur := min(float64(rp.InitialBackoff)*fact, float64(rp.MaxBackoff))
// apply a jitter of plus or minus 0.2
// Apply jitter by multiplying with a random factor between 0.8 and 1.2
cur *= 0.8 + 0.4*rand.Float64()
dur = time.Duration(int64(cur))
cs.numRetriesSincePushback++
Expand Down

0 comments on commit 81ae30b

Please sign in to comment.