[Twisted-Python] Missing feature in detecting stalled PB connections?

Luc Stepniewski luc.stepniewski at adelux.fr
Mon Feb 20 09:02:00 EST 2006

While using pb.PBClientFactory() with reactor.connectTCP(), I noticed that the 
specified timeout parameter is only for testing if there is no connection, 
not if the remote PB replies correctly.
I noticed this when one of my remote PB instance was stuck. It was accepting 
requests, but did not answer anything at all. So the connection is 
established, and stays indefinitely!

You can verify this by yourself by just putting netcat ("nc -vv -l -p 9999" 
for example) instead of a PB instance.
The PB on the other side will connect, and then, nothing else. No timeout that 
netcat didn't reply (not even correctly).

I know I could add a timer (callLater) that would wake up and kill the 
connection after some time (because I know one transaction will not exceed 
some precise time), but it's really really trashy, and one not always knows 
what will be the duration of the transaction.

Is there really no other alternative to detect the correct connection to 
another PB instance?

I attached an example code that would show this behaviour.

Luc Stepniewski <luc.stepniewski at adelux.fr> <sip:724766 at fwd.pulver.com>
Adelux - Securite, Linux  Public key: <http://lstep.free.fr/pubkey.txt>
Key BC0E3C2A fingerprint = A4FA466C68D27E46B427  07D083ED6340BC0E3C2A
-------------- next part --------------
A non-text attachment was scrubbed...
Name: bug.py
Type: application/x-python
Size: 1737 bytes
Desc: not available
Url : http://twistedmatrix.com/pipermail/twisted-python/attachments/20060220/85ad57b0/attachment.bin 

More information about the Twisted-Python mailing list