← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1734832] Re: Unreachable 'ImageSizeLimitExceeded' exception block in upload call

 

Reviewed:  https://review.openstack.org/523366
Committed: https://git.openstack.org/cgit/openstack/glance/commit/?id=ffc3923e93dc1d4eea789ce5163d176efb7d685b
Submitter: Zuul
Branch:    master

commit ffc3923e93dc1d4eea789ce5163d176efb7d685b
Author: Abhishek Kekane <akekane@xxxxxxxxxx>
Date:   Tue Nov 28 09:51:02 2017 +0000

    Fix unreachable 'ImageSizeLimitExceeded' exception in image-upload
    
    ImageSizeLimitExceeded exception block [1] is unreachable in upload because
    it is caught at [2] and raised StorageQuotaFull exception from there. The
    problem here is that we have nested usage of the limiting reader.
    
    To make it correct changed the limiting reader to accept
    exception class as parameter so that we can pass the StorageQuotaFull
    in case LimitingReader is used for quota check and ImageSizeExceeded exception
    if it is used for image size cap check.
    
    [1] https://github.com/openstack/glance/blob/fd16fa4f258fd3f77c14900a019e97bb90bc5ac0/glance/api/v2/image_data.py#L230
    [2] https://github.com/openstack/glance/blob/fd16fa4f258fd3f77c14900a019e97bb90bc5ac0/glance/quota/__init__.py#L305
    
    Closes-Bug: #1734832
    Change-Id: I5a419b763bee7f983c2a94c6f3a2245281e86743


** Changed in: glance
       Status: In Progress => Fix Released

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to Glance.
https://bugs.launchpad.net/bugs/1734832

Title:
  Unreachable 'ImageSizeLimitExceeded' exception block in upload call

Status in Glance:
  Fix Released

Bug description:
  ImageSizeLimitExceeded exception block [1] is unreachable in upload because
  it is caught at [2] and raised StorageQuotaFull exception from there.

  Further as it raised StorageQuataFull exception it prints None as a
  size in the glance-api logs.

  Reference glance-api-logs:
  Nov 28 07:04:13 devstack devstack@g-api.service[11453]: ERROR glance.api.v2.image_data [None req-17b243db-9b3d-46d9-97f0-05f74bc76e18 admin admin] Image exceeds the storage quota: The size of the data None will exceed the limit. None bytes remaining.: StorageQuotaFull: The size of the data None will exceed the limit. None bytes remaining.

  To make it correct we need to remove code from [2] where
  ImageSizeLimitExceeded is caught and StorageQuotaFull is raised so
  that it will be reachable in the controller [1].

  [1] https://github.com/openstack/glance/blob/master/glance/api/v2/image_data.py#L232
  [2] https://github.com/openstack/glance/blob/master/glance/quota/__init__.py#L305

To manage notifications about this bug go to:
https://bugs.launchpad.net/glance/+bug/1734832/+subscriptions


References