Skip to content

Misleading backoff parameter #34

@michellemay

Description

@michellemay

Current Behavior

backoff_options.retry_after is misleading. It seems to be an absolute number of seconds. However, it's a multiplicative factor.

See backoff_factor=self.backoff_options.retry_after, in PlatformClient

And relevant implementation from urllib3:
https://github.com/urllib3/urllib3/blob/b34619f94ece0c40e691a5aaf1304953d88089de/src/urllib3/util/retry.py#L143

:param float backoff_factor:
        A backoff factor to apply between attempts after the second try
        (most errors are resolved immediately by a second try without a
        delay). urllib3 will sleep for::

            {backoff factor} * (2 ** ({number of previous retries}))

        seconds. 

The readme is wrong as well:

The exponential backoff parameters are as follows:

retry_after - The amount of time, in seconds, to wait between throttled request attempts.

Optional, will default to 5.

Expected Behavior

Change the variable name to match what it does.

Steps To Reproduce

No response

Environment

Python Version
OS Version
...

Debug logs

No response

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions