Established connection is never closed on Python 2.7
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
python-swiftclient |
Fix Released
|
High
|
Tim Burke |
Bug Description
When we use python2.7 and python-
For example if you run 5 swiftclient.
~~~
>>> import swiftclient
>>> url, token = swiftclient.
>>> swiftclient.
>>> swiftclient.
>>> swiftclient.
>>> swiftclient.
>>> swiftclient.
~~~
You see that the process still has 5 TCP connection in ESTABLISHED status.
~~~
vagrant@
...
Output information may be incomplete.
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
python 16245 vagrant cwd DIR 8,3 4096 400663 /home/vagrant/
...
python 16245 vagrant 3u IPv4 2193105 0t0 TCP localhost:
python 16245 vagrant 4u IPv4 2195534 0t0 TCP localhost:
python 16245 vagrant 5u IPv4 2195673 0t0 TCP localhost:
python 16245 vagrant 6u IPv4 2195695 0t0 TCP localhost:
python 16245 vagrant 7u IPv4 2195717 0t0 TCP localhost:
python 16245 vagrant 13r CHR 1,9 0t0 11 /dev/urandom
~~~
This issue was observed in storlets functional tests, which use swiftclient to test api requests, and this remaining connections cause 'too many open files' error because the test process keeps lots of opened connections.
We don't observe the same in our py3 tests, so it seems that this happens only on Python2.7.
Also, we don't reproduce the issue after we switch to swiftclient 3.8.1, so the issue caused by some changes during 3.8.1 and 3.9.0 .
description: | updated |
Changed in python-swiftclient: | |
status: | Confirmed → In Progress |
Thanks for the detailed bug report! Ironically, I think this was caused by https:/ /review. opendev. org/#/c/ 674320/ which attempted to solve exactly the same problem :-( I think https:/ /review. opendev. org/721051 should fix it reasonably well, though?