Work around for httplib2 retries on timeout

httplib2 automatically retries a request on a timeout even if the request
is a POST. This can lead to orphaned objects being created that we
don't know about. This patch sets httplib2.RETRIES to 1 to avoid this.

Note: httplib2.RETRIES is only available in new versions of httplib2.
See: https://code.google.com/p/httplib2/issues/detail?id=124 for more
details.

Co-Authored-By: Ashwin Raveendran <ashw7n@gmail.com>
Co-Authored-By: Sudheendra Murthy <sudhi.vm@gmail.com

Change-Id: I5648b644bb9df1fd2ea219159794d9d122696af0
Closes-bug: #1267649
This commit is contained in:
Aaron Rosen 2014-01-09 17:45:47 -08:00
parent df0f5d2c1d
commit d661414a43
2 changed files with 5 additions and 1 deletions

@ -30,6 +30,10 @@ from neutronclient.openstack.common.gettextutils import _
_logger = logging.getLogger(__name__)
# httplib2 retries requests on socket.timeout which
# is not idempotent and can lead to orhan objects.
# See: https://code.google.com/p/httplib2/issues/detail?id=124
httplib2.RETRIES = 1
if os.environ.get('NEUTRONCLIENT_DEBUG'):
ch = logging.StreamHandler()

@ -1,7 +1,7 @@
pbr>=0.5.21,<1.0
argparse
cliff>=1.4.3
httplib2
httplib2>=0.7.5
iso8601>=0.1.4
simplejson>=2.0.9
six>=1.4.1