[Bug 1559079] Re: swiftclient.service upload leaks filehandles for large files
Tim Burke
tim at swiftstack.com
Tue Mar 14 17:34:25 UTC 2017
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()
** Changed in: python-swiftclient
Status: New => Confirmed
--
You received this bug notification because you are a member of Ubuntu
OpenStack, which is subscribed to python-swiftclient in Ubuntu.
https://bugs.launchpad.net/bugs/1559079
Title:
swiftclient.service upload leaks filehandles for large files
Status in python-swiftclient:
Confirmed
Status in python-swiftclient package in Ubuntu:
Confirmed
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 = SwiftUploadObject(tmpfile, object_name=tmpfile)
swift.upload(container="mycontainer", objects=[obj])
After this, lsof shows /tmp/wibble is still open (multiple times)
This approach works around the problem:
with open(tmpfile, "r") as f:
obj = SwiftUploadObject(f, object_name=tmpfile)
swift.upload(container=container, objects=[obj]):
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://gb.archive.ubuntu.com/ubuntu/ wily/main amd64 Packages
100 /var/lib/dpkg/status
To manage notifications about this bug go to:
https://bugs.launchpad.net/python-swiftclient/+bug/1559079/+subscriptions
More information about the Ubuntu-openstack-bugs
mailing list