swiftclient.service upload leaks filehandles for large files
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
python-swiftclient |
Fix Committed
|
Undecided
|
Kazufumi Noto | ||
python-swiftclient (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
When uploading large files (i.e. multi-segment ones) using the swiftclient.service functions, if you pass a file path instead of a file object it seems to leave the files open after upload.
For example:
tmpfile = "/tmp/wibble"
obj = SwiftUploadObje
swift.upload(
After this, lsof shows /tmp/wibble is still open (multiple times)
This approach works around the problem:
with open(tmpfile, "r") as f:
obj = SwiftUploadObje
swift.
While I've seen this on the wily packaged version, it also appears to be a problem in the upstream (3.0) python module.
$ lsb_release -rd
Description: Ubuntu 15.10
Release: 15.10
$ apt-cache policy python-swiftclient
python-swiftclient:
Installed: 1:2.6.0-1ubuntu1
Candidate: 1:2.6.0-1ubuntu1
Version table:
*** 1:2.6.0-1ubuntu1 0
500 http://
100 /var/lib/
Changed in python-swiftclient: | |
assignee: | nobody → Kazufumi Noto (knoto) |
status: | Confirmed → In Progress |
Changed in python-swiftclient (Ubuntu): | |
status: | Confirmed → Fix Released |
Sure enough, we've got an open() at https:/ /github. com/openstack/ python- swiftclient/ blob/3. 3.0/swiftclient /service. py#L1718 with no close()