-
Notifications
You must be signed in to change notification settings - Fork 26
Open
Description
Issue
The docs says that:
| exceptions: Iterable[type[Exception]] | None = None, # On which exceptions we should retry, by default on all |
So, it's expected that it retries on exceptions by default. But, it doesn't, as None is transformed into an empty set:
aiohttp_retry/aiohttp_retry/retry_options.py
Lines 29 to 31 in 1a3bc19
| if exceptions is None: | |
| exceptions = set() | |
| self.exceptions: Iterable[type[Exception]] = exceptions |
Which then causes the retry condition to always fail:
aiohttp_retry/aiohttp_retry/client.py
Line 144 in 1a3bc19
| is_exc_valid = any(isinstance(e, exc) for exc in self._retry_options.exceptions) |
as any(<empty>) always returns False.
Solution
Either this is a documentation issue (should mention that, by default, doesn't retry on exceptions), or the documentation is right, in which case the default should be changed from set() to {Exception}.
Workaround
Set exceptions={Exception}.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels