You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ansible/cloud
Stefan Hajnoczi 47cc422b8a Stream image data in load_image() to avoid out-of-memory
Reading the entire tar file into memory can result in out-of-memory
conditions such as this traceback:

Traceback (most recent call last):
  File "/tmp/ansible_YELTSu/ansible_module_docker_image.py", line 486, in load_image
    self.client.load_image(image_data)
  File "/usr/local/lib/python2.7/dist-packages/docker/api/image.py", line 147, in load_image
    res = self._post(self._url("/images/load"), data=data)
  ...
  File "/usr/lib/python2.7/httplib.py", line 997, in endheaders
    self._send_output(message_body)
  File "/usr/lib/python2.7/httplib.py", line 848, in _send_output
    msg += message_body
MemoryError

Luckily docker-py's load_image(), which calls requests post(), accepts a
file-like object instead of a string.  Pass in the file object to avoid
reading the full file into memory.  This allows larger tar files to load
succesfully.

Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
9 years ago
..
amazon Add an example to delete Route53 alias record set (#3834) 9 years ago
azure Fix 3857 name regex 9 years ago
digital_ocean Fixing compile time error exception handling for python 3. (#3843) 9 years ago
docker Stream image data in load_image() to avoid out-of-memory 9 years ago
google correct gs_storage docs to match reality 9 years ago
linode Py3 exclude list (#3698) 9 years ago
openstack Fixing open stack compile time errors irt exception handling for Python 3 (#3848) 9 years ago
rackspace Fixing Rackspace compile time errors irt exception handling for Python 3 (#3849) 9 years ago
vmware Port vsphere_guest to py3/py2.4 syntax (#3721) 9 years ago
__init__.py