[Chicago] threads and xmlrpc?

Lukasz Szybalski szybalski at gmail.com
Thu Jan 29 07:08:56 CET 2009


Hello,
I'm running a threaded app using some calls via xmlrpc. The problem I
run into is that connection is reset by peer after about 10min (~500
calls). I use a single connection and a queue of 8 threads to get the
data. Would anybody have an example on how to run xmlrpc in a thread?
Do I set multiple connections, or is there a setting to keep the
connection live or reconnect if disconnected?

I've tried to catch the error but that is not working well. I don't
want to connect connect for each request, It would be best if somehow
I keep the connection live.

Thanks,
Lucas


Traceback (most recent call last):
  File "/usr/lib/python2.5/threading.py", line 486, in __bootstrap_inner
    self.run()
  File "pypi.py", line 29, in run
    version=pypi.package_releases(package)[0]
  File "/usr/lib/python2.5/xmlrpclib.py", line 1147, in __call__
    return self.__send(self.__name, args)
  File "/usr/lib/python2.5/xmlrpclib.py", line 1437, in __request
    verbose=self.__verbose
  File "/usr/lib/python2.5/xmlrpclib.py", line 1185, in request
    errcode, errmsg, headers = h.getreply()
  File "/usr/lib/python2.5/httplib.py", line 1199, in getreply
    response = self._conn.getresponse()
  File "/usr/lib/python2.5/httplib.py", line 928, in getresponse
    response.begin()
  File "/usr/lib/python2.5/httplib.py", line 385, in begin
    version, status, reason = self._read_status()
  File "/usr/lib/python2.5/httplib.py", line 343, in _read_status
    line = self.fp.readline()
  File "/usr/lib/python2.5/socket.py", line 372, in readline
    data = recv(1)
error: (104, 'Connection reset by peer')


-- 
How to create python package?
http://lucasmanual.com/mywiki/PythonPaste
Bazaar and Launchpad
http://lucasmanual.com/mywiki/Bazaar


More information about the Chicago mailing list