skrydal opened a new issue, #2772:
URL: https://github.com/apache/iceberg-python/issues/2772
### Feature Request / Improvement
**Problem statement**
REST Catalog client uses `requests` library to perform HTTP calls.
Currently, if there is an intermittent network/server problem resulting in an
error code being returned, `pyiceberg` library would not retry. This is a
common problems for out-of-box `requests` usage. Also timeout for the calls is
not set.
**Solution outline**
Since retrying/timeout functionalities are very much needed for any HTTP
clients, there are classes, available off-the-shelf, which can be used:
* `urllib3.util.retry.Retry` - to define strategy
* `requests.adapters.HTTPAdapter` - to use the strategy
`HTTPAdapter` object can be mounted by request's `session`.
Timeout could be provided directly to the http calls made by the `session`,
but even better `HTTPAdapter` is commonly extended, to include the timeout
parameter in all calls.
There would need to be couple of new parameters provided to the catalog
config. They could look as below:
```
type: 'rest'
uri: "http://localhost:8181"
connection:
retry:
backoff_factor: 0.5
total: 3
status_forcelist: [500]
timeout: 120
```
`retry` key value could be fed directly into the `__init__` of urllibs
[Retry](https://urllib3.readthedocs.io/en/latest/reference/urllib3.util.html#urllib3.util.Retry)
class.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]