Memory leaks due connections left open?
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
python-swiftclient |
New
|
Undecided
|
Unassigned |
Bug Description
Using swiftclient.
while True:
with SwiftService(...) as swift:
for stat_futures in swift.stat(
...
sleep(1)
Note the memory impact does not change even upon moving the object outside while loop. Running a docker container executing this code, docker stats command reports consistently increasing memory usage, until process has been killed at the moment reaching container memory limit.
I have localized the cause and possible issue within swiftclient.
Indeed, upon I added following method to body of ConnectionThrea
def __exit__(self, exc_type, exc_value, traceback):
# Close all HTTP connections when the object is exited
while not self._connectio
_, conn = self._connectio
if conn is not None:
Maybe I am missing somtehing, as I've found no reference about how should client code be aware of pooled connections?