← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1618928] Re: Glance Content-Range request returns incorrect Content-Length

 

Reviewed:  https://review.openstack.org/367528
Committed: https://git.openstack.org/cgit/openstack/glance/commit/?id=400230cd9d72f00caf6c1d5824da906ea335a1ad
Submitter: Jenkins
Branch:    master

commit 400230cd9d72f00caf6c1d5824da906ea335a1ad
Author: Dharini Chandrasekar <dharini.chandrasekar@xxxxxxxxx>
Date:   Thu Sep 8 17:03:40 2016 +0000

    Handling HTTP range requests in Glance
    
    Currently Glance does not send Partial response codes while
    handling HTTP range requests. Also, content length is not
    appropriately set.
    
    This patch is to send partial response code and to set the correct
    content length based on the range request for image download.
    
    Upon success status code 206 is sent and the content length is set to the
    requested range.
    Upon failure, there can be 2 cases:
     * If the HTTP range request for the image download is bad (For example,
       requesting download of range of bytes 10 to 50 bytes when there are only 48
       bytes), status code is set to 416 and HTTPRequestRangeNotSatisfiable is
       raised.
     * If the content range is valid, but the request is not satisfiable due to
       glance_store side erros or privacy issues, appropriate exceptions are
       raised.
    
    APIImpact
    DocImpact
    
    Closes-Bug: #1417069
    Closes-Bug: #1624508
    Closes-Bug: #1399851
    Closes-Bug: #1618928
    
    Change-Id: I3cd47b998be79604511b3cd4879209820cf776b7


** 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/1618928

Title:
  Glance Content-Range request returns incorrect Content-Length

Status in Glance:
  Fix Released

Bug description:
  When using the Glance API's Content-Range support to partially
  download an image, the server sets a Content-Length header equal to
  the size of the full image, rather than the size of the chunk
  specified by the Content-Range. This causes clients to wait
  indefinitely for the server.

  Version-Release number of selected component (if applicable):
  It at least affects Glance 11.0.1

  Steps to Reproduce:
  1. Make an authenticated GET request to /v2/images/<some_image_id>/file with
     the Content-Range header set to some value smaller than the entire length
     of the image.
  2. Wait

  Actual results:
  Server returns a Content-Length header equal to the length of the whole image but only transmitting the requested bytes. The client waits indefinitely for the server to continue sending.

  Expected results:
  Server returns a Content-Length header equal to the number of bytes in the chunk, so that the client can know to disconnect.

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


References