2nd example: when polling a status with 5 seconds interval (= KeepAliveTimeout=5), the API request eventually fails with a fatal error. It's known to happen when the interval is exactly the same as KeepAliveTimeout discussed in multiple places, e.g. https://github.com/psf/requests/issues/4664 https://bugs.python.org/issue41345 https://docs.openstack.org/python-keystoneclient/latest/using-sessions.html ==== from keystoneauth1.identity import v3 from keystoneauth1 import session from keystoneclient.v3 import client import logging logging.basicConfig(level=logging.DEBUG) from time import sleep auth = v3.Password(auth_url="https://192.168.151.112:5000/v3", username="admin", password="MY_PASSWORD", project_name="admin", user_domain_name="admin_domain", project_domain_name="admin_domain") sess = session.Session(auth=auth, verify="/home/ubuntu/snap/openstackclients/common/root-ca.crt") keystone = client.Client(session=sess) while True: keystone.projects.list() sleep(5) ==== ... DEBUG:keystoneauth.session:GET call to identity for https://192.168.151.112:35357/v3/projects used request id req-37b4e617-3272-440e-90fe-bbfcebe0c865 [, , , ] DEBUG:keystoneauth.session:REQ: curl -g -i --cacert "/home/ubuntu/snap/openstackclients/common/root-ca.crt" -X GET https://192.168.151.112:35357/v3/projects? -H "Accept: application/json" -H "User-Agent: python-keystoneclient" -H "X-Auth-Token: {SHA256}dff1fb0579fd35bfe46ef6574aadfda8993582d4ea2514e13fed16c181dec24d" Traceback (most recent call last): File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 665, in urlopen httplib_response = self._make_request( File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 421, in _make_request six.raise_from(e, None) File "", line 3, in raise_from File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 416, in _make_request httplib_response = conn.getresponse() File "/usr/lib/python3.8/http/client.py", line 1344, in getresponse response.begin() File "/usr/lib/python3.8/http/client.py", line 307, in begin version, status, reason = self._read_status() File "/usr/lib/python3.8/http/client.py", line 276, in _read_status raise RemoteDisconnected("Remote end closed connection without" http.client.RemoteDisconnected: Remote end closed connection without response