coveo / coveo/push-api-client.py
Misleading backoff parameter
- Dominant language
- Python
- Stars
- 1
- Forks
- 4
- PR merge metrics
- No merged PRs in 30d
Description
### 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
```Markdown
Python Version
OS Version
...
```
### Debug logs
_No response_
### Anything else?
_No response_
Contributor guide
No contributing guide indexed for this repository
Research direction
Find PlatformClient and all references to backoff_options.retry_after, then compare its usage with the linked urllib3 Retry implementation. Update the parameter name and the README description so they reflect a multiplicative backoff factor, and verify that references and relevant tests remain consistent.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- api
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 48/100