^c during image downloads leaves incomplete files in cache

Bug #1031842 reported by Tom Hancock
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Glance
Fix Released
High
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.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to glance (master)

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

Changed in glance:
assignee: nobody → Tom Hancock (tom-hancock)
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to glance (master)

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)
Changed in glance:
importance: Undecided → High
milestone: none → folsom-3
Thierry Carrez (ttx)
Changed in glance:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in glance:
milestone: folsom-3 → 2012.2
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.