too many threads due to synch communication

Posted by MasoudIzzy on Stack Overflow See other posts from Stack Overflow or by MasoudIzzy
Published on 2010-05-10T20:54:54Z Indexed on 2010/05/10 21:14 UTC
Read the original article Hit count: 179

Filed under:
|
|

I'm using threads and xmlrpclib in python at the same time. Periodically, I create a bunch of thread to complete a service on a remote server via xmlrpclib. The problem is that, there are times that the remote server doesn't answer. This causes the thread to wait forever for a response which it never gets. Over time, number of threads in this state increases and will reach the maximum number of allowed threads on the system (I'm using fedora). I tried to use socket.setdefaulttimeout(10); but the exception that is created by that will cause the server to defunct. I used it at server side but it seems that it doesn't work :/

Any idea how can I handle this issue?

© Stack Overflow or respective owner

Related posts about python

Related posts about thread