integ/docker/python-docker/centos/patches/0001-Update-client-close-socket.patch
John Kung 3f4a439109 Fix socket growth on system application operations
There is an issue whereby docker exec_run commands do not close the TCP socket.
Thus on each kube application operation, such as application-apply, the docker
exec_run consumes 4 TCP sockets per iteration.  Thus, when it hits limit
of 1024 sockets, system can no longer perform application operations.

This updates the python-docker package. The source code was already in the
cengn mirror; and this update adds a patch to finally close socket in
docker client.

Tests performed:
Install AIO, Storage labs.
system application-upload stx-openstack, apply, remove
system application apply stress test of over 300 iterations
and verify no growth in sockets held by sysinv-conductor.

Change-Id: I21b9e486af1e3bb3b82fd79c3e3662c97b53b732
Closes-Bug: 1838088
Depends-On: https://review.opendev.org/#/c/675686/
Signed-off-by: John Kung <john.kung@windriver.com>
2019-08-09 15:45:35 -04:00

29 lines
837 B
Diff

From cbe001760e9893015b1576cba05ebce0938038e4 Mon Sep 17 00:00:00 2001
From: John Kung <john.kung@windriver.com>
Date: Wed, 7 Aug 2019 14:06:04 -0400
Subject: [PATCH 1/1] Update client close socket
---
docker/api/client.py | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/docker/api/client.py b/docker/api/client.py
index 13c292a..7df5eb1 100644
--- a/docker/api/client.py
+++ b/docker/api/client.py
@@ -370,7 +370,10 @@ class APIClient(
if stream:
return gen
else:
- return six.binary_type().join(gen)
+ try:
+ return six.binary_type().join(gen)
+ finally:
+ response.close()
def _disable_socket_timeout(self, socket):
""" Depending on the combination of python version and whether we're
--
1.8.3.1