yaocaigen / httplib2

Automatically exported from code.google.com/p/httplib2
0 stars 0 forks source link

Allow retry to be configured/turned off #109

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

h = Http(timeout=1)
h.request("http://myslowlyrespondingwebservice")

What is the expected output? What do you see instead?

When the request times out, Http.request automatically makes a second request. 
In the case of a simple GET, this is ok, but it also happens on POSTs, which 
typically change state (it also affects poorly designed webservice API that 
only handles GETs). The net result is that the same action may be performed 
twice.

It would be helpful to be able to pass a "retries" argument to either the Http 
constructor or to Http.request so you can control the number of retries for a 
request or turn them off completely.

What version of the product are you using? On what operating system?

0.5.0, 0.6.0, python 2.5, 2.6, Mac OSX 10.6.4, 
0.6.0, python 2.5, Debian lenny

Please provide any additional information below.

Original issue reported on code.google.com by chris.c....@gmail.com on 27 Aug 2010 at 3:21

GoogleCodeExporter commented 9 years ago
+1. Although I think it should not have a retry by default. Make it fail and 
let the app decide the retry policy itself.

Original comment by alexandr...@gmail.com on 4 Dec 2010 at 7:56

GoogleCodeExporter commented 9 years ago

Original comment by joe.gregorio@gmail.com on 13 Feb 2011 at 5:53