[Twisted-Python] Epoll error after upgrading from 10.0 to 12.3

Alec Matusis matusis at yahoo.com
Sun Mar 3 00:21:57 EST 2013


I had 60 busy tcp servers that ran on Python 2.6/Twisted 10.0 (or Twisted
9.0) for over two years with not problems. After I upgraded to Twisted
12.3/Python 2.7, I started getting the errors below (no application code
changes). It took about two days for the first error to appear on a busy
server under heavy load:

[twisted.internet.protocol.ServerFactory] Unhandled Error
        Traceback (most recent call last):
          File
"/usr/local/encap/Python-2.7.3/lib/python2.7/site-packages/twisted/python/lo
g.py", line 73, in callWithCon
text
            return context.call({ILogContext: newCtx}, func, *args, **kw)
          File
"/usr/local/encap/Python-2.7.3/lib/python2.7/site-packages/twisted/python/co
ntext.py", line 118, in callWi
thContext
            return self.currentContext().callWithContext(ctx, func, *args,
**kw)
          File
"/usr/local/encap/Python-2.7.3/lib/python2.7/site-packages/twisted/python/co
ntext.py", line 81, in callWit
hContext
            return func(*args,**kw)
          File
"/usr/local/encap/Python-2.7.3/lib/python2.7/site-packages/twisted/internet/
posixbase.py", line 614, in _d
oReadOrWrite
            why = selectable.doRead()
        --- <exception caught here> ---
          File
"/usr/local/encap/Python-2.7.3/lib/python2.7/site-packages/twisted/internet/
tcp.py", line 1069, in doRead
            transport = self.transport(skt, protocol, addr, self, s,
self.reactor)
          File
"/usr/local/encap/Python-2.7.3/lib/python2.7/site-packages/twisted/internet/
tcp.py", line 786, in __init__
            self.startReading()
          File
"/usr/local/encap/Python-2.7.3/lib/python2.7/site-packages/twisted/internet/
abstract.py", line 429, in sta
rtReading
            self.reactor.addReader(self)
          File
"/usr/local/encap/Python-2.7.3/lib/python2.7/site-packages/twisted/internet/
epollreactor.py", line 256, in
 addReader
            _epoll.EPOLLIN, _epoll.EPOLLOUT)
          File
"/usr/local/encap/Python-2.7.3/lib/python2.7/site-packages/twisted/internet/
epollreactor.py", line 240, in
 _add
            self._poller.modify(fd, flags)
        exceptions.IOError: [Errno 2] No such file or directory


After the error occurs, the server usually locks up and does not accept new
connections. One server self-recovered after these errors after 30min
outage, and started accepting new connections.
Apparently I am not the ony one who has enountered this:
http://stackoverflow.com/questions/12600137/twisted-internet-epollreactor-py
-line-238-in-add

Is there a patch available, or should I roll back to 10.0.0?





More information about the Twisted-Python mailing list