1

I use the Libcloud 3.3.1 python library to download objects from an Openstack swift provider.

When using the requests package, one can specify the connect and read timeouts to avoid getting stuck when retrieving a file.

Is it posssible to define such timeouts in the Libcloud package? I know I can give a timeout in the connection arguments but that doesn't seem to do what I want (it is a retry timeout).

I also have been thinking about using the signal package and this reply, but once again this is not exactly what I want and I would like to avoid doing such things.

Rémi Chauvenne
  • 344
  • 1
  • 10
  • 1
    looks like you can't without modifying the libcloud library. It internally uses `requests`, but doesn't specify a timeout when calling `requests.Session().request` in the `LibCloudConnection` class [(see `libcloud.http.LibcloudConnection.request`)](https://github.com/apache/libcloud/blob/trunk/libcloud/http.py#L220) – Aaron Apr 04 '21 at 03:12
  • @rémi-chauvenne can you provide the code for which you are creating the connection parameter? As per your reference you are showing that you use [libcloud.common.base.Connection](https://libcloud.readthedocs.io/en/stable/apidocs/libcloud.common.html#libcloud.common.base.Connection) whereas, the openshift connection object if used with `LibcloudConnection` can have the timeout of requests – Nagaraj Tantri Apr 04 '21 at 16:52

0 Answers0