[Twisted-Python] Strange behaviour for epoll reactor

Alvin Delagon adelagon at gmail.com
Tue Dec 11 20:56:44 EST 2007

To summarize Jean-Paul's link, you can just a two-liner patch in the
epollreactor.py to fix this (after line 201 if you're using the
twisted 2.50release)

if event & _epoll.HUP or event & _epoll.ERR:
                    why = main.CONNECTION_LOST

On Dec 11, 2007 9:57 PM, Jean-Paul Calderone <exarkun at divmod.com> wrote:

> On Tue, 11 Dec 2007 15:06:45 +0200, Mustafa Sakalsiz <sakalsiz at gmail.com>
> wrote:
> >We have a twisted application uses the epoll reactor. Sometimes it
> >wastes %100 cpu. It has also some threads for single isolated
> >functions (using deferToThred). First we suspected that threads don't
> >end and goes to an infinite loop. Because application still accepts
> >connections and executes the requested functions. Then I ran the
> >following ps command
> >
> >ps h -Leo pid,pcpu,args,lwp
> >
> >Looking at the output, the main thread seemed to be wasting the whole
> >cpu time. Later on I attached the process to the strace and saw the
> >output below. I don't how does it happen or when does it happen. It is
> >not regular nor repeatable, but this is the strace output when it gets
> >into loop. I send to the list, because it may be useful for someone.
> >
> >Now we switched back to the select reactor.
> >
> >P.S.: We use perspective broker on the server side and qt4reactor for
> >the client.
> This sounds like this issue:
>  http://twistedmatrix.com/trac/ticket/2809
> This is fixed in current trunk at HEAD and the fix will be included in the
> next release of Twisted.
> Jean-Paul
> _______________________________________________
> Twisted-Python mailing list
> Twisted-Python at twistedmatrix.com
> http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://twistedmatrix.com/pipermail/twisted-python/attachments/20071212/e1aa3435/attachment.htm 

More information about the Twisted-Python mailing list