Threadpool + COMMTIMEOUT = TimeoutError?

Éric Piel <[email protected]>
Newsgroups gmane.comp.python.pyro
Message-ID <[email protected]>
Hello,

In my program I've tried to add timeouts to the configuration of Pyro, 
thinking it would make it a bit safer if some method (of a shared 
object) gets crazy and loops forever. So I've added this:
Pyro4.config.COMMTIMEOUT = 30.0

But now, 30 seconds after an object on the "server" has not been used 
(which is completely normal in my program), the "server" generates the 
following error (and then seems to accept new connections but the 
objects already connected don't work anymore):

2012-08-07 09:52:46,302 (threadpoolserver) DEBUG: stopping worker Pyro 
connection manager 164532044
Exception in thread Pyro connection manager 164532044:
Traceback (most recent call last):
   File "/usr/lib/python2.7/threading.py", line 551, in __bootstrap_inner
     self.run()
   File 
"/home/piel/development/Pyro4/src/Pyro4/socketserver/threadpoolserver.py", 
line 56, in run
     self.callbackDaemon.handleRequest(self.csock)
   File "/home/piel/development/Pyro4/src/Pyro4/core.py", line 1142, in 
handleRequest
     msgType, flags, seq, data = MessageFactory.getMessage(conn, 
MessageFactory.MSG_INVOKE)
   File "/home/piel/development/Pyro4/src/Pyro4/core.py", line 910, in 
getMessage
     headerdata = connection.recv(cls.HEADERSIZE)
   File "/home/piel/development/Pyro4/src/Pyro4/socketutil.py", line 
336, in recv
     return receiveData(self.sock, size)
   File "/home/piel/development/Pyro4/src/Pyro4/socketutil.py", line 
119, in receiveData
     raise TimeoutError("receiving: timeout")
TimeoutError: receiving: timeout


If I change to multiplex, this doesn't happen. My understanding is that 
there is a timeout on the SocketWorker (in handleRequest())and the 
thread dies. Catching the exception didn't really help.

So my questions are:
  * is this expected?
  * is there something to be fixed in the threadpool to not have timeout 
on waiting for a new request?

Cheers,
Éric


PS: this is with more or less latest SVN head (Pyro ~4.15) with CPython.



------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.