Skip to content

Commit

Permalink
config: change default non-produce retries from unlimited to 30
Browse files Browse the repository at this point in the history
Non-produce requests should *not* retry indefinitely. This pairs with
the default request failure limit of 1minute.
  • Loading branch information
twmb committed Jun 6, 2021
1 parent 3b01b64 commit b26489f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/kgo/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ func defaultCfg() cfg {
return backoff
}
}(),
retries: math.MaxInt64, // effectively unbounded
retries: 30,
retryTimeout: func(key int16) time.Duration {
if key == 26 { // EndTxn key
return 5 * time.Minute
Expand Down Expand Up @@ -462,7 +462,7 @@ func RetryBackoff(backoff func(int) time.Duration) Opt {
}

// RequestRetries sets the number of tries that retriable requests are allowed,
// overriding the unlimited default. This option does not apply to produce
// overriding the default of 30. This option does not apply to produce
// requests; to limit produce request retries, see ProduceRetries.
func RequestRetries(n int) Opt {
return clientOpt{func(cfg *cfg) { cfg.retries = int64(n) }}
Expand Down

0 comments on commit b26489f

Please sign in to comment.