Swift segmentation does not close file handles

Bug #1642896 reported by fabianschwarzfritz
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-swiftclient
New
Undecided
Unassigned

Bug Description

Hi,

I'm currently using the python swiftclient in version 3.0.0. However I'm pretty sure the bug still exists in the most recent version of the swiftclient 3.2.0. I did not test that though.

My goal is to upload a large file with file segmentation enabled, using swifts upload method (https://github.com/openstack/python-swiftclient/blob/master/swiftclient/service.py#L1349). I want to upload a file from a temporary mounted volume. After the upload was successful, I am unmounting the temporary volume from my current VM. With the current implementation, the umount fails because there are open file handles, even if the swift upload is already done successfully.

After some debugging I found out that the file handle here (https://github.com/openstack/python-swiftclient/blob/master/swiftclient/service.py#L1716) is not closed properly and my assumption is that this causes the issue. I changed the code to open the file handler using pythons 'with' statement and everything is working fine. With the change there are no open file handles that block the unmount of the volume.

I'm neither a python expert nor do I have a lot of knowledge of the current implementation, but currently I don't see any other way of closing the file handle with the change mentioned.

For me, using the swift segmentation feature to upload content from a volume that is detached after upload seems necessary for the feature i want to implement. Do you see any other ways to fix this issue?

Cheers,
Fabian

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.