Timeout not correctly set inside requests session object
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
etcd3gw |
Fix Released
|
High
|
Unassigned |
Bug Description
There is currently no timeout set in the requests session object, which means it will wait indefinitely and cause the process to hang if no response is received.
For more information, see https:/
Steps to reproduce this Bug:
$ cat >timeout1.py<<EOF
import etcd3gw
client = etcd3gw.
resp = client.
print(resp.
EOF
Expected behavior:
requests.
Actual behavior:
$ python3 timeout1.py
200
The issue can be resolved utilizing functools - https:/
These are my proposed changes in fixing the timeout issue.
diff --git a/etcd3gw/client.py b/etcd3gw/client.py
index 43690ce..63fb588 100644
--- a/etcd3gw/client.py
+++ b/etcd3gw/client.py
@@ -10,6 +10,7 @@
# License for the specific language governing permissions and limitations
# under the License.
+import functools
import json
import os
import queue
@@ -57,7 +58,10 @@ class Etcd3Client(
if timeout is not None:
- self.session.
+ self.session.
+ else:
+ self.session.
+
if ca_cert is not None:
if cert_cert is not None and cert_key is not None:
description: | updated |
information type: | Public → Public Security |
information type: | Public Security → Public |
Changed in python-etcd3gw: | |
importance: | Undecided → High |
Fix proposed to branch: master /review. opendev. org/c/openstack /etcd3gw/ +/908585
Review: https:/