Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
python-asyncio: update retry factors for actual exponential retries (#…
…19337) * python-asyncio: update retry factors for actual exponential retries As per the `aiohttp-retry` library's code[^1], the timeout is ```python timeout = self._start_timeout * (self._factor ** attempt) ``` This means the previous setting with "start_timeout=0.0" would have always just retried right away (0 timeout) regardless of the "factor" value, and also, "factor=0.0" would never have increased the timeout, rather it would have resulted in a 0 timeout regardless of the value of "start_timeout". This double-zeroing effectively rendered exponential backoff to nothing (rather than "retries" number of retries in quick succession. The update is a quick fix to set the same default as in `aiohttp-retry`. In the future this should likely be configurable (through extra Configuration settings perhaps?), as not all APIs are created equal, but this works as a quick fix for making retries more effective. [^1]: https://github.com/inyutin/aiohttp_retry/blob/ba2169891f5b32a5c59e48ca185dd8e68e44ded7/aiohttp_retry/retry_options.py#L38-L65 * updated example
- Loading branch information