Hi guys, I have started having this problem a few weeks ago and it happens about once a week after which I have to restart my Twisted based server to function again. It seems to be happening when I make RPC calls using twisted.web.xmlrpc.Proxy. I have reason to believe that I am either running out of file handles or connection limits. I have up-sized my connection limits and ulimit -n  gives me 9000.

I receive less than 30 connections though so there must be some kind of leak. The error I'm getting is the following:

 Unhandled Error
    Traceback (most recent call last):
      File "/usr/lib/python2.6/dist-packages/twisted/application/app.py", line 445, in startReactor
        self.config, oldstdout, oldstderr, self.profiler, reactor)
      File "/usr/lib/python2.6/dist-packages/twisted/application/app.py", line 348, in runReactorWithLogging
        reactor.run()
      File "/usr/lib/python2.6/dist-packages/twisted/internet/base.py", line 1128, in run
        self.mainLoop()
      File "/usr/lib/python2.6/dist-packages/twisted/internet/base.py", line 1140, in mainLoop
        self.doIteration(t)
    --- <exception caught here> ---
      File "/usr/lib/python2.6/dist-packages/twisted/internet/selectreactor.py", line 104, in doSelect
        [], timeout)
    exceptions.ValueError: filedescriptor out of range in select()



Now I know this is a very generic error and it could mean a lot of things, but how would I even start tracking the leak down? Is there a way I can try and track the number of file descriptors?

I am using Twisted version 8.2.0 on Ubuntu Server Edition 9.10