Open rad-pat opened 1 year ago
can you please file a PR to start with? we'll review the enhancement accordingly
While the generated Python asyncio library has retries since #17014, it is not effective due to the choices of the retry options (namely start_timeout
and factor
). Setting them both to 0 will effectively run all the retries in a batch in quick succession.
These parameters should have some saner defaults (so there's actually some retry behaviour in the generated code) in the short term, and potentially configurable values on the long term.
Just FYI, the original PR was to replicate the behaviour in the sync version of the API, which I believe didn't set any values for backoff or factor (using urllib3 defaults of zero). The new PR makes the async version behave differently to the sync version.
Is your feature request related to a problem? Please describe.
The synchronous version of REST client supports basic retries through
urllib3
library using theretries
configuration parameter. The asyncio version should support the same behaviour such that the retries parameter can be honoured in this version.I attempted a change to the template files that would appear to handle the case using the
aiohttp-retry
library. There were no tests for retry in the synchronous version so I have not added any to this change. Please feel free to improve upon this, the feature would be useful.https://github.com/rad-pat/openapi-generator/tree/add-basic-retry-asyncio