When a ConnectionError occurs, python-requests <= 2.8.0
and/or urllib3 <= 1.11, connections are not returned to
the pool.
This change adds a CustomHTTPAdapter to workaround this
issue.
This HTTPAdapter doesn't trigger theses urllib3 issues.
This HTTPAdapter workaround this by enforcing preloading
of the response. When enabled, urllib3 releases the connection
to the pool immediately after its usage, and doesn't trigger the
issue.
By enforcing preloading, this break some requests
features (like stream) that we didn't use into our GnocchiClient
Reviewed: https:/ /review. openstack. org/226700 /git.openstack. org/cgit/ openstack/ ceilometer/ commit/ ?id=03769b699f6 f98e775c2b8deac ee8cd45cbc7095
Committed: https:/
Submitter: Jenkins
Branch: master
commit 03769b699f6f98e 775c2b8deacee8c d45cbc7095
Author: Mehdi Abaakouk <email address hidden>
Date: Wed Sep 23 13:05:05 2015 +0200
Workaround requests/urllib connection leaks
When a ConnectionError occurs, python-requests <= 2.8.0
and/or urllib3 <= 1.11, connections are not returned to
the pool.
This change adds a CustomHTTPAdapter to workaround this
issue.
This HTTPAdapter doesn't trigger theses urllib3 issues.
This HTTPAdapter workaround this by enforcing preloading
of the response. When enabled, urllib3 releases the connection
to the pool immediately after its usage, and doesn't trigger the
issue.
By enforcing preloading, this break some requests
features (like stream) that we didn't use into our GnocchiClient
Upstream bugs:
* https:/ /github. com/shazow/ urllib3/ issues/ 659 /github. com/shazow/ urllib3/ issues/ 651 /github. com/shazow/ urllib3/ issues/ 644 /github. com/kennethreit z/requests/ issues/ 2687
* https:/
* https:/
* https:/
We could remove this when requests 2.8.0 will be released
Closes-bug: #1498823 909e230613777cb a1f7537c0ec
Change-Id: I7d40ade927b834