Bug 1013643 - Glance download is not interrupted when the InputStream is closed
Summary: Glance download is not interrupted when the InputStream is closed
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: openstack-java-sdk
Version: 3.3.0
Hardware: Unspecified
OS: Unspecified
unspecified
urgent
Target Milestone: ---
: 3.3.0
Assignee: Federico Simoncelli
QA Contact: Elad
URL:
Whiteboard: storage
Depends On:
Blocks: 1019461 3.3snap3
TreeView+ depends on / blocked
 
Reported: 2013-09-30 13:54 UTC by Federico Simoncelli
Modified: 2016-02-10 18:54 UTC (History)
10 users (show)

Fixed In Version: is24
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-01-21 22:17:30 UTC
oVirt Team: Storage
Target Upstream Version:
Embargoed:
abaron: Triaged+


Attachments (Terms of Use)

Description Federico Simoncelli 2013-09-30 13:54:16 UTC
Description of problem:
It is impossible to abruptly close the InputStream used to download a glance image, in fact when close() is called the entire image is downloaded before shutting down the tcp connection.

This is a serious issue for applications such as rhevm-backend that are using the InputStream to inspect the QCOW2 header in order to discover the image virtual size.

Even more since resteasy (shipped in jboss) is using the SelfExpandingBufferredInputStream under the hood I also suspect that the entire image is not only downloaded but also cached in memory (leading to out of memory crashes).

Version-Release number of selected component (if applicable):
openstack-java-sdk-3.0.0-1.el6ev

How reproducible:
100%

Steps to Reproduce:
1. Import a large (>~2Gb) QCOW2 glance image from rhev webadmin (or rest api)

Actual results:
The entire image is downloaded (from the engine backend); the canDoAction validation takes a long time (inspecting the image virtual size).

Expected results:
Only the initial part of the image should be downloaded (resulting in a quick canDoAction and no memory usage).

Additional info:
This bug should be moved to openstack-java-sdk as soon as it will appear in the components list.

Comment 1 Federico Simoncelli 2013-09-30 13:55:18 UTC
A fix has been proposed upstream:

https://github.com/simon3z/openstack-java-sdk/commit/c4f9cbefd618be11562e41a076d3a3501f7db0fe

Comment 3 Elad 2013-12-17 12:59:58 UTC
The CanDoAction validation takes a short time (1 sec) when downloading a QCOW2 image (3G in size) 

Verified on is27

Comment 4 Itamar Heim 2014-01-21 22:17:30 UTC
Closing - RHEV 3.3 Released

Comment 5 Itamar Heim 2014-01-21 22:24:03 UTC
Closing - RHEV 3.3 Released


Note You need to log in before you can comment on or make changes to this bug.