yahoo-eng-team team mailing list archive
-
yahoo-eng-team team
-
Mailing list archive
-
Message #21071
[Bug 1061722] Re: Regression in handling of 0 sized remote images
This bug is so old that if the issue still persists we should open new
one.
** Changed in: glance
Status: Incomplete => Invalid
--
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to Glance.
https://bugs.launchpad.net/bugs/1061722
Title:
Regression in handling of 0 sized remote images
Status in OpenStack Image Registry and Delivery Service (Glance):
Invalid
Bug description:
It seems a problem exists around remote images added with a missing or
0 size.
Change I3093eba1 was added to HEAD the remote for the size in this
case. However, what about 0 size images added before this patch?
Change I7656bc97 should handle these by grabbing the size from the
cache. Unfortunately Change I61e96f3f appears to effectively break
the former as it sets images with a 0 size in the registry to an empty
iterator, before it even reaches the cache:
# simulate a remote image
$ echo 'hello world' > foo
$ { echo -ne "HTTP/1.0 200 OK\r\nContent-Length: $(wc -c <foo)\r\n\r\n"; cat foo; } | nc -l 8080
# add it to glance
$ curl -X POST -H "X-Image-Meta-Name:Image0" -H "X-Image-Meta-disk_format:raw" -H "X-Image-Meta-container_format:ovf" -H "X-Image-Meta-Is-Public:True" -H "X-Image-Meta-Location: http://localhost:8080" http://localhost:9292/v1/images
# simulate bug 900959 (i.e. a remote image added before the logic to fetch the size was introduced), by setting the size in the registry to 0
$ sqlite3 -line /var/lib/glance/glance.sqlite "update images set size=0 where id='7c6fea6b-817b-48ba-af06-0f22bcc4e018';"
# now try to download the image
$ curl http://localhost:9292/v1/images/7c6fea6b-817b-48ba-af06-0f22bcc4e018
# Nothing returned!
# empty file placed in the cache
$ ls -s /var/lib/glance/image-cache/7c6fea6b-817b-48ba-af06-0f22bcc4e018
0 /var/lib/glance/image-cache/7c6fea6b-817b-48ba-af06-0f22bcc4e018
To manage notifications about this bug go to:
https://bugs.launchpad.net/glance/+bug/1061722/+subscriptions