^c during image downloads leaves incomplete files in cache

Bug #1031842 reported by Tom Hancock on 2012-08-01
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Tom Hancock

Bug Description

While fetching an image from a server for which the image cache is enabled, and for which the image
is not already cached, if the user issues ^C then the partial image remains in incomplete/
This means any subsequent retries to fetch the image, fetch it directly from the backend until the
image in incomplete/ is removed. When the backend speed is slower than the cache this makes
fetches slower.
Ideally the image should be moved from incomplete/ to invalid/ whenever ^c is issued.

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

Changed in glance:
assignee: nobody → Tom Hancock (tom-hancock)
status: New → In Progress

Reviewed: https://review.openstack.org/10663
Committed: http://github.com/openstack/glance/commit/a30887aa3b7a220a1f722e94fa69201e5878e766
Submitter: Jenkins
Branch: master

commit a30887aa3b7a220a1f722e94fa69201e5878e766
Author: Tom Hancock <email address hidden>
Date: Wed Aug 1 15:58:46 2012 +0000

    ^c shouldn't leave incomplete images in cache

    Fixes LP bug 1031842

    Use a finally clause for the xattr and sqlite
    image cache implementations of open_for_write()
    such that if the commit() or rollback() aren't
    called and the image remains in the incomplete
    dir that it is moved to the invalid dir

    Change-Id: Id9a0ac56a8ae9fd03af9ccc4989c9b304c95bdde

Changed in glance:
status: In Progress → Fix Committed
Brian Waldon (bcwaldon) on 2012-08-03
Changed in glance:
importance: Undecided → High
milestone: none → folsom-3
Thierry Carrez (ttx) on 2012-08-15
Changed in glance:
status: Fix Committed → Fix Released
Thierry Carrez (ttx) on 2012-09-27
Changed in glance:
milestone: folsom-3 → 2012.2
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers