Bug 1013643 - Glance download is not interrupted when the InputStream is closed
Glance download is not interrupted when the InputStream is closed
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: openstack-java-sdk (Show other bugs)
Unspecified Unspecified
unspecified Severity urgent
: ---
: 3.3.0
Assigned To: Federico Simoncelli
Depends On:
Blocks: 1019461 3.3snap3
  Show dependency treegraph
Reported: 2013-09-30 09:54 EDT by Federico Simoncelli
Modified: 2016-02-10 13:54 EST (History)
10 users (show)

See Also:
Fixed In Version: is24
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2014-01-21 17:17:30 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: Storage
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
abaron: Triaged+

Attachments (Terms of Use)

  None (edit)
Description Federico Simoncelli 2013-09-30 09:54:16 EDT
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):

How reproducible:

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 09:55:18 EDT
A fix has been proposed upstream:

Comment 3 Elad 2013-12-17 07:59:58 EST
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 17:17:30 EST
Closing - RHEV 3.3 Released
Comment 5 Itamar Heim 2014-01-21 17:24:03 EST
Closing - RHEV 3.3 Released

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