ImageSizeLimitExceeded results in data leak

Bug #1214276 reported by John Bresnahan
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Glance
Fix Released
Medium
Zhi Yan Liu

Bug Description

When uploading data the true size of the upload is not always known up front. Thus in some cases the entire image must arrive before the image size is known. This causes a problem when trying to implement quota and when trying to limit the size of any given image

In order to implement a size limit on upload of a given image the iterator (ie: image_size_cap). To deal with this the iterator LimitingReader was created. This is a wrapper around the incoming data that throws a ImageSizeLimitExceeded exception when a liit is reach. This effectively protects the system from receiving more than the alloted ammount.

However, when that error occurs the already received data is never cleaned up. The fix for this must be in each data store. The higher level abstractions do not know the location of the data until it is all successfully written.

Changed in glance:
importance: Undecided → Medium
milestone: none → havana-3
assignee: nobody → Zhi Yan Liu (lzy-dev)
Zhi Yan Liu (lzy-dev)
Changed in glance:
status: New → In Progress
Revision history for this message
Zhi Yan Liu (lzy-dev) wrote :

After I checking from the details, currently gridfs, rbd, sheepdog store drivers have this leaking issue, and filesystem, swift and s3 store drivers is OK.

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/42896

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

Reviewed: https://review.openstack.org/42896
Committed: http://github.com/openstack/glance/commit/436c2569551b4c8cab04e1cb32591cd32ea67d16
Submitter: Jenkins
Branch: master

commit 436c2569551b4c8cab04e1cb32591cd32ea67d16
Author: Zhi Yan Liu <email address hidden>
Date: Tue Aug 20 21:40:29 2013 +0800

    Clean up data when store receiving image occurs error

    Clean up already received data from backend store to prevent potential
    leaking when driver receiving image occurs error such as
    ImageSizeLimitExceeded exception.

    Fixes bug: 1214276

    Change-Id: Ice1de4d1c61a62fff778acbbeb9bc27d03ed7ab4
    Signed-off-by: Zhi Yan Liu <email address hidden>

Changed in glance:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in glance:
status: Fix Committed → Fix Released
Revision history for this message
Yang Yu (yuyangbj) wrote : I will be on vacation from 9/5 to 9/15, urgent call: 13811509950

I will be out of the office starting 2013-09-05 and will not return until
2013-09-15.

I will be on my marriage leave from 9/5 to 9/15, for any urgent issue
please call me before 9/7.

For daily work, please ask my scrum master Zhu Zhu for help.
For glance issue, please ask glance SME Feilong Wang for help.
For defect report, there will be no report next week.

Thierry Carrez (ttx)
Changed in glance:
milestone: havana-3 → 2013.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.