Skip to content

Commit

Permalink
config: change default backoff from 100ms-1s to 250ms-2.5s
Browse files Browse the repository at this point in the history
100ms always seemed fast, and 1s seems like a low cap. 250ms is still
fast but at least seems more like a bit of a backoff, and 2.5s as well
is a bit more of a relaxed upper bound.
  • Loading branch information
twmb committed Oct 28, 2021
1 parent c197efd commit 6912cfe
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkg/kgo/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -405,8 +405,8 @@ func defaultCfg() cfg {
rng := rand.New(rand.NewSource(time.Now().UnixNano()))
return func(fails int) time.Duration {
const (
min = 100 * time.Millisecond
max = time.Second
min = 250 * time.Millisecond
max = 5 * time.Second / 2
)
if fails <= 0 {
return min
Expand Down Expand Up @@ -638,7 +638,7 @@ func MinVersions(versions *kversion.Versions) Opt {

// RetryBackoffFn sets the backoff strategy for how long to backoff for a given
// amount of retries, overriding the default jittery exponential backoff that
// ranges from 100ms min to 1s max.
// ranges from 250ms min to 2.5s max.
//
// This (roughly) corresponds to Kafka's retry.backoff.ms setting and
// retry.backoff.max.ms (which is being introduced with KIP-500).
Expand Down

0 comments on commit 6912cfe

Please sign in to comment.