Cannot stream http image

Bug #804429 reported by Brian Waldon
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Glance
Fix Released
Critical
Jay Pipes

Bug Description

'm trying to add an image with the following command. It adds to the registry successfully, but a subsequent GET will not stream the image data to me.

curl -X POST -i \
       -H "X-Image-Meta-Name: image" \
       -H "X-Image-Meta-Container_format: ami" \
       -H "X-Image-Meta-Disk_format: ami" \
       -H "X-Image-Meta-Size: 25165824" \
       -H "X-Image-Meta-Store: http" \
       -H "X-Image-Meta-Checksum: 10047a119149e08fb206eea89832eee0" \
       -H "X-Image-Meta-Location: <example_http_image>" \
       http://localhost:9292/v1/images

I get the following headers, then the connection just sits open without printing any body:

HTTP/1.1 200 OK
Content-Length: 25165824
Content-Type: application/octet-stream
X-Image-Meta-Id: 15
X-Image-Meta-Deleted: False
X-Image-Meta-Container_format: ami
X-Image-Meta-Location: <example_http_image>
X-Image-Meta-Deleted_at:
X-Image-Meta-Created_at: 2011-06-29T21:16:45.989329
X-Image-Meta-Size: 25165824
X-Image-Meta-Status: active
X-Image-Meta-Is_public: False
X-Image-Meta-Updated_at: 2011-06-29T21:16:46.011739
X-Image-Meta-Checksum: 10047a119149e08fb206eea89832eee0
X-Image-Meta-Disk_format: ami
X-Image-Meta-Name: image
Location: http://localhost:9292/v1/images/15
Etag: 10047a119149e08fb206eea89832eee0
Date: Wed, 29 Jun 2011 21:17:02 GMT

Brian Waldon (bcwaldon)
Changed in glance:
importance: Undecided → Critical
status: New → Confirmed
Revision history for this message
Jay Pipes (jaypipes) wrote :

Looks like the Location: returned is incorrect. Should be the originally-supplied HTTP location, right?

Changed in glance:
assignee: nobody → Jay Pipes (jaypipes)
milestone: none → diablo-4
Jay Pipes (jaypipes)
Changed in glance:
milestone: diablo-4 → diablo-rbp
Thierry Carrez (ttx)
Changed in glance:
milestone: diablo-rbp → 2011.3
Jay Pipes (jaypipes)
Changed in glance:
assignee: Jay Pipes (jaypipes) → nobody
Revision history for this message
Brian Waldon (bcwaldon) wrote :

After actually getting into it, I think this is a duplicate of bug 794582

Changed in glance:
assignee: nobody → Brian Waldon (bcwaldon)
status: Confirmed → In Progress
Revision history for this message
Jay Pipes (jaypipes) wrote :

This actually has to do with the try: finally: block you identified in the http store driver that calls conn.close() in the finally: block... I'm reassigning to myself and going to push a fix for just this bug using some of your code from the Gerrit review that attempted to fix both this bug and 794582.

Jay Pipes (jaypipes)
Changed in glance:
assignee: Brian Waldon (bcwaldon) → Jay Pipes (jaypipes)
Revision history for this message
Openstack Gerrit (openstack-gerrit) wrote : A change has been merged to openstack/glance

Reviewed: https://review.openstack.org/475
Committed: http://github.com/openstack/glance/commit/7ce40a7486b23a400dca4112c6ab36658912dcef
Submitter: Jenkins
Branch: master

 status fixcommitted
 done

commit 7ce40a7486b23a400dca4112c6ab36658912dcef
Author: Jay Pipes <email address hidden>
Date: Fri Sep 16 14:48:03 2011 -0400

    Fixes LP Bug #804429

    The try: finally: block which called conn.close() in the
    http store driver was flawed and the connection was not
    being properly released. This changes the
    http_response_iterator generator to accept the HTTP connection
    and close it on final yield.

    Change-Id: I545a7f5c93ccd196a99b50e8464778e075b549d8

Changed in glance:
status: In Progress → Fix Committed
Revision history for this message
Openstack Gerrit (openstack-gerrit) wrote :

Reviewed: https://review.openstack.org/476
Committed: http://github.com/openstack/glance/commit/22e8bf58f08e54a407fa8182e6d8262be39aacd9
Submitter: Jenkins
Branch: milestone-proposed

 status fixcommitted
 done

commit 22e8bf58f08e54a407fa8182e6d8262be39aacd9
Author: Jay Pipes <email address hidden>
Date: Fri Sep 16 14:48:03 2011 -0400

    Fixes LP Bug #804429

    The try: finally: block which called conn.close() in the
    http store driver was flawed and the connection was not
    being properly released. This changes the
    http_response_iterator generator to accept the HTTP connection
    and close it on final yield.

    Change-Id: I545a7f5c93ccd196a99b50e8464778e075b549d8

Thierry Carrez (ttx)
Changed in glance:
status: Fix Committed → Fix Released
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.