aboutsummaryrefslogtreecommitdiffstats
path: root/meta-openstack/recipes-devtools/python/python3-hp3parclient/fix_hp3parclient_memory_leak.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta-openstack/recipes-devtools/python/python3-hp3parclient/fix_hp3parclient_memory_leak.patch')
-rw-r--r--meta-openstack/recipes-devtools/python/python3-hp3parclient/fix_hp3parclient_memory_leak.patch37
1 files changed, 37 insertions, 0 deletions
diff --git a/meta-openstack/recipes-devtools/python/python3-hp3parclient/fix_hp3parclient_memory_leak.patch b/meta-openstack/recipes-devtools/python/python3-hp3parclient/fix_hp3parclient_memory_leak.patch
new file mode 100644
index 00000000..25aebc0e
--- /dev/null
+++ b/meta-openstack/recipes-devtools/python/python3-hp3parclient/fix_hp3parclient_memory_leak.patch
@@ -0,0 +1,37 @@
+---
+ hp3parclient/http.py | 10 ++++++++++
+ 1 file changed, 10 insertions(+)
+
+--- a/hp3parclient/http.py
++++ b/hp3parclient/http.py
+@@ -66,6 +66,7 @@
+ self.set_debug_flag(http_log_debug)
+
+ self.times = [] # [("item", starttime, endtime), ...]
++ self.times_max_len = 200
+
+ # httplib2 overrides
+ self.force_exception_to_status_code = True
+@@ -141,6 +142,12 @@
+ """
+ self.times = []
+
++ def get_timings_max_len(self):
++ return self.times_max_len
++
++ def set_timings_max_len(self, new_len):
++ self.times_max_len = new_len
++
+ def _http_log_req(self, args, kwargs):
+ if not self.http_log_debug:
+ return
+@@ -208,6 +215,9 @@
+ resp, body = self.request(url, method, **kwargs)
+ self.times.append(("%s %s" % (method, url),
+ start_time, time.time()))
++ # remove oldest items until we maintain max length
++ while len(self.times) > self.times_max_len:
++ del self.times[0]
+ return resp, body
+
+ def _do_reauth(self, url, method, ex, **kwargs):