Comment 11 for bug 1616105

Revision history for this message
Kairat Kushaev (kkushaev) wrote : Re: Request of large files raises a MemoryError due to logging

one of os users reproduced similar problem with the following scenario:
download glance image with --debug option

Image must be quite big.
If debug is turned on we got here:
https://github.com/openstack/keystoneauth/blob/459f3c0926b1cf62dadafb014b8e7a98e20dc6b9/keystoneauth1/session.py#L357
response.text tries to read all data before passing params to _remove_service_catalog.
After that we got:
https://zerobin.net/?bfd05129e9029bdf#hOFzRJUn1XdbbHLvDbxG45ufbGN50F0q8Esf+niph1M=
which indicates that requests tries to read all image as var in memory.
Apparently, we don't need to prematurely read response body in some cases.
Please also consider that glance is using chunked responses so we don't have overall response size in this case.