nova error handling causes glance to keep unlinked files open, wasting space

Bug #1461678 reported by Chris Friesen
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Glance Client
Fix Released
Medium
Unassigned
OpenStack Compute (nova)
Fix Released
Medium
Chris Friesen

Bug Description

When creating larger glance images (like a 10GB CentOS7 image), if we run into situation where we run out of room on the destination device, we cannot recover the space from glance. glance-api will have open unlinked files, so a TONNE of space is unavailable until we restart glance-api.

Nova will try to reschedule the instance 3 times, so should see this nova-conductor.log :
u'RescheduledException: Build of instance 98ca2c0d-44b2-48a6-b1af-55f4b2db73c1 was re-scheduled: [Errno 28] No space left on device\n']

The problem is this code in nova.image.glance.GlanceImageService.download():

        if data is None:
            return image_chunks
        else:
            try:
                for chunk in image_chunks:
                    data.write(chunk)
            finally:
                if close_file:
                    data.close()

image_chunks is an iterator. If we take an exception (like we can't write the file because the filesystem is full) then we will stop iterating over the chunks. If we don't iterate over all the chunks then glance will keep the file open.

Tags: compute
Chris Friesen (cbf123)
Changed in nova:
assignee: nobody → Chris Friesen (cbf123)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

Fix proposed to branch: master
Review: https://review.openstack.org/188179

Changed in nova:
status: New → In Progress
Matt Riedemann (mriedem)
Changed in nova:
importance: Undecided → Medium
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on nova (master)

Change abandoned by Chris Friesen (<email address hidden>) on branch: master
Review: https://review.openstack.org/188179
Reason: I think https://review.openstack.org/#/c/190359/ will be a better fix.

Revision history for this message
Chris Friesen (cbf123) wrote :

Not sure why it wasn't linked, but https://review.openstack.org/#/c/190359/ is being proposed as a fix to this issue.

Revision history for this message
Davanum Srinivas (DIMS) (dims-v) wrote :
Changed in nova:
status: In Progress → Fix Committed
Erno Kuvaja (jokke)
Changed in python-glanceclient:
status: New → Fix Committed
importance: Undecided → Medium
Changed in python-glanceclient:
milestone: none → 1.0.0
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: none → liberty-3
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: liberty-3 → 12.0.0
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.