To summarize Jean-Paul&#39;s link, you can just a two-liner patch in the epollreactor.py to fix this (after line 201 if you&#39;re using the twisted 2.50 release)<br><br>if event &amp; _epoll.HUP or event &amp; _epoll.ERR:
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; why = main.CONNECTION_LOST<br><br><br><div class="gmail_quote">On Dec 11, 2007 9:57 PM, Jean-Paul Calderone &lt;<a href="mailto:exarkun@divmod.com">exarkun@divmod.com</a>&gt; wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="Ih2E3d">On Tue, 11 Dec 2007 15:06:45 +0200, Mustafa Sakalsiz &lt;<a href="mailto:sakalsiz@gmail.com">sakalsiz@gmail.com</a>&gt; wrote:<br>&gt;We have a twisted application uses the epoll reactor. Sometimes it<br>
&gt;wastes %100 cpu. It has also some threads for single isolated<br>&gt;functions (using deferToThred). First we suspected that threads don&#39;t<br>&gt;end and goes to an infinite loop. Because application still accepts
<br>&gt;connections and executes the requested functions. Then I ran the<br>&gt;following ps command<br>&gt;<br>&gt;ps h -Leo pid,pcpu,args,lwp<br>&gt;<br>&gt;Looking at the output, the main thread seemed to be wasting the whole
<br>&gt;cpu time. Later on I attached the process to the strace and saw the<br>&gt;output below. I don&#39;t how does it happen or when does it happen. It is<br>&gt;not regular nor repeatable, but this is the strace output when it gets
<br>&gt;into loop. I send to the list, because it may be useful for someone.<br>&gt;<br>&gt;Now we switched back to the select reactor.<br>&gt;<br>&gt;P.S.: We use perspective broker on the server side and qt4reactor for<br>
&gt;the client.<br><br></div>This sounds like this issue:<br><br> &nbsp;<a href="http://twistedmatrix.com/trac/ticket/2809" target="_blank">http://twistedmatrix.com/trac/ticket/2809</a><br><br>This is fixed in current trunk@HEAD
 and the fix will be included in the<br>next release of Twisted.<br><font color="#888888"><br>Jean-Paul<br></font><div><div></div><div class="Wj3C7c"><br>_______________________________________________<br>Twisted-Python mailing list
<br><a href="mailto:Twisted-Python@twistedmatrix.com">Twisted-Python@twistedmatrix.com</a><br><a href="http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python" target="_blank">http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
</a><br></div></div></blockquote></div><br>