httplib2 icon indicating copy to clipboard operation
httplib2 copied to clipboard

Reading the actual request may trigger CONNRESET on a cached connection

Open smurfix opened this issue 10 years ago • 3 comments

This moves the block that reads the data up into the try: block.

I hit this issue while testing aioamqp with pyrabbit. The sequence of events is:

  • send request without auth header
  • get an error
  • … meanwhile, the server starts thinking about what you just did (like doing a DNS lookup for its error log)
  • re-send the request with auth header
  • … the server gets around to deciding that it wants to close your connection, and does so
  • get an ECONNRESET error reading the reply. :-(

This can also happen when you're re-using a cached connection after some time and hit the server's decision that it has waited long enough and will now close the connection.

Thus, please apply.

smurfix avatar Nov 19 '15 17:11 smurfix

Of course I meant "Reading the response."

I fixed the commit's comment and re-uploaded.

smurfix avatar Nov 19 '15 18:11 smurfix

Any progress? this change is necessary on py3.5.

smurfix avatar Dec 19 '15 11:12 smurfix

this is required to fix https://github.com/Polyconseil/aioamqp/issues/50

smurfix avatar Dec 19 '15 11:12 smurfix