Closed GoogleCodeExporter closed 8 years ago
Unfortunately the code has been like that for a long time where it
automatically retries once on a failed connect. I am worried about making a
change here breaking existing code that depends on the current behavior.
Original comment by joe.gregorio@gmail.com
on 13 Feb 2011 at 5:05
Actually it broke my code because I needed an exact timeout. I was forced to
switch to httplib. Based on this response I will never use httplib2. An API
shouldn't lie to its programmers.
Original comment by firealwa...@gmail.com
on 13 Feb 2011 at 5:24
Issue 109 has been merged into this issue.
Original comment by joe.gregorio@gmail.com
on 13 Feb 2011 at 5:53
[deleted comment]
I think the best path would be to make the retries configurable, and default it
to the current behavior of 2 tries. Wouldn't that satisfy everyone?
I've made a simple patch: http://codereview.appspot.com/4365054/
Original comment by ned...@gmail.com
on 11 Apr 2011 at 2:23
That is bad behavior default behavior. I am building a testing framework with
HTTP, if you magically fire off 2 http requests or double the timeout my tests
will magically fail.
Original comment by firealwa...@gmail.com
on 11 Apr 2011 at 4:15
@firealwa...: if this were a new library, I would agree with you: the default
should be no retries. But Joe has a point: this library has been in wide use
with the default of 2. Keeping it is not difficult, and my patch will give you
the control you need to disable the retries.
Original comment by ned...@gmail.com
on 11 Apr 2011 at 7:34
Is there any chance nedbat's patch will be integrated into the core library?
My organization uses httplib2 to request resources that can be computationally
intensive. If the request times out, it's probably because it's still busy
calculating the response. In those cases the last thing we want to do is issue
another request, which will start another instance of the calculations.
I understand leaving the behavior as it is, though I do think documentation
should be updated to clearly indicate that requests will be retried. I really
hope to see nedbat's patch integrated into the main branch so that we do not
have to maintain a separate branch of httplib2. Having an unconfigurable retry
makes httplib2 unusable for our purposes without the patch.
Original comment by aus...@gmail.com
on 18 Jul 2011 at 4:05
Please reopen and apply the patch provided.
It is not reasonable to have a hard-coded retry. I happened to run into this
today when some other code had set socket's default timeout to 5 second. This
resulted in two POSTs going out and both failing with a socket.timeout
exception because it took more than 5 seconds to read the first byte. Removing
the 5 second timeout fixed things of course, but I was *really* surprised to
see two requests go out.
Original comment by bhiggins
on 22 Nov 2011 at 12:23
Please for the love of god at least apply the patch to make it configurable if
you don't want to change the default.
This is the only HTTP library I know of that has this behavior and every time I
run into an issue caused by this it takes me forever to figure it out, because
I would never expect a HTTP library to retry by default. This time I got a nice
nonce_already_used from an OAuth 1 API because of the retry behavior and an
request that timed out.
Original comment by florian....@gmail.com
on 8 Mar 2012 at 10:43
Please apply the patch. What florian said. Very confusing behaviour, but
worse that there's no way to turn it off. Argh.
Original comment by boulton.rj@gmail.com
on 3 Apr 2012 at 4:36
Fixed in
http://code.google.com/p/httplib2/source/detail?r=a0d2b4b2f1357659bbdf9d257a053c
a82ac49272
Original comment by joe.gregorio@gmail.com
on 17 Apr 2012 at 4:42
Any chance we can get an official release with this fix in it?
Original comment by aus...@gmail.com
on 20 Jun 2012 at 10:13
Original issue reported on code.google.com by
firealwa...@gmail.com
on 5 Jan 2011 at 12:53