Skip to content

SetRetryCount allows negative values that Backoff doesn't properly handle #404

@moorereason

Description

@moorereason

SetRetryCount allows values less than zero, but the Backoff implementation assumes opts.maxRetries is zero or greater. The result is that Backoff doesn't actually make a request but also doesn't return an error.

Two options for a solution:

  1. Convert negative values to zero in SetRetryCount.
  2. Convert a negative value into math.MaxInt64 (retry forever) in SetRetryCount.

In either case, Backoff should be updated to return an error if opts.maxRetries is less than zero.

Related to #392

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions