[issue1531775] HTTPSConnection request hangs

2010-10-18 Thread Senthil Kumaran

Senthil Kumaran orsent...@gmail.com added the comment:

Not an issue anymore as socket timeout at client is supposed to happen with the 
connection is hung due to unresponsive host.
The original bug was raised py2.3. Closing it as out of date.

--
nosy: +orsenthil
resolution:  - out of date
stage: unit test needed - committed/rejected
status: open - closed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1531775
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1531775] HTTPSConnection request hangs

2010-09-20 Thread Charles-Francois Natali

Charles-Francois Natali neolo...@free.fr added the comment:

Skimming through the code, the only place where we can reasonably block is 
inside HTTPConnection._send_output(), when the data is actually sent to the 
socket.
What probably happens is the following:
- connect() call succeeded, we have an established TCP connection
- before request() is called - or in the middle of the sending - the host at 
the other host goes down in brutal way, so that we don't receive a FIN/RST: the 
TCP stack has no clue that the remote host went down
- we keep sending data through the socket, until the socket write buffer fills 
up, and then, since httplib uses blocking sockets by default, we block on the 
send() call

Now, depending on the TCP stack setting, after a given number of retries the 
stack will decide the other host went down, and return an error. But this can 
take a long time (under Linux, it's set by net.ipv4.tcp_retries2 sysctl by 
default to 30 minutes).
The only thing that surprises me here is that when the host is back online, we 
should get a RST, but it depends on the OS, the timeouts, maybe there's a 
statefull firewall, etc.

So I'd say it's not a httplib issue here, it's just a standard behaviour of a 
TCP connection when an host goes down.

Note that the solution is simply to use non-blocking socket, and it's already 
implemented. Heck, it's even documented actually:

class httplib.HTTPConnection(host[, port[, strict[, timeout[, 
source_address)
If the optional timeout parameter is given, blocking operations (like 
connection attempts) will timeout after that many seconds (if it is not given, 
the global default timeout setting is used).

So for me it's not an issue, but given the lack of infos, maybe I got it 
completely wrong ;-)

--
nosy: +neologix

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1531775
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1531775] HTTPSConnection request hangs

2010-08-24 Thread Mark Lawrence

Mark Lawrence breamore...@yahoo.co.uk added the comment:

Is this still a problem with later versions of Python?

--
nosy: +BreamoreBoy
versions: +Python 2.7, Python 3.1, Python 3.2 -Python 2.6, Python 3.0

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1531775
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1531775] HTTPSConnection request hangs

2010-08-24 Thread Giampaolo Rodola'

Changes by Giampaolo Rodola' g.rod...@gmail.com:


--
nosy: +giampaolo.rodola

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1531775
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1531775] HTTPSConnection request hangs

2009-03-29 Thread Daniel Diniz

Daniel Diniz aja...@gmail.com added the comment:

This needs a test case reproducing the 'unexpected close'.

--
nosy: +ajaksu2
stage:  - test needed
type:  - behavior
versions: +Python 2.6, Python 3.0

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1531775
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com