<div dir="ltr"><div><div><div>Hi Exarkun,<br><br></div>I tried hacking the addWriter method as follows:<br><span style="font-family:courier new,monospace">        add_writer_orig = reactor.__class__.addWriter #@UndefinedVariable<br>

        def my_add_writer(self, writer):<br>            logging.warn(writer.__class__.__mro__)<br>            logging.warn(''.join(traceback.format_stack()))<br>            if isinstance(writer,Port):<br>                raise Exception("Shouldn't add a port as a writer")<br>

            return add_writer_orig(self, writer)<br>        reactor.addWriter = types.MethodType(my_add_writer,reactor)</span><br></div>But I actually got nothing out of it. I also noticed this backtrace (or similar) is sometimes with a Udp.Port, not only a Unix.Port:<br>

<span style="font-family:courier new,monospace">Unhandled Error<br>Traceback (most recent call last):<br>  File "/path/to/twisted.zip/twisted/python/log.py", line 88, in callWithLogger<br>  File "/path/to/twisted.zip/twisted/python/log.py", line 73, in callWithContext<br>

  File "/path/to/twisted.zip/twisted/python/context.py", line 118, in callWithContext<br>  File "/path/to/twisted.zip/twisted/python/context.py", line 81, in callWithContext<br>--- <exception caught here> ---<br>

  File "/path/to/twisted.zip/twisted/internet/posixbase.py", line 619, in _doReadOrWrite<br>  File "/path/to/twisted.zip/twisted/internet/base.py", line 1117, in doWrite<br>exceptions.RuntimeError: doWrite called on a twisted.internet.udp.Port</span><br>

<br> Any other ideas how I could find out the culprit?<br><br></div>Thank you,<br><br>Killian<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On 7 May 2014 17:09, Killian De Smedt <span dir="ltr"><<a href="mailto:killiands@gmail.com" target="_blank">killiands@gmail.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div>Hi Exarkun,<br><br>Thanks for the quick response. I should have specified those things immediately.<br>

</div>I manually merged the UDP ipv6 branch in the trunk somewhere in august and used that one, the version number is reported as [twisted, version 13.1.0].<br>
</div>The platform is always centos though the centos version might range from 5.x to 6.x, 32 bit, but most of the time it runs on a centos 5.2 installation (kernel on my working machine is 2.6.18). Python is 2.7.1 .<br>

</div>
<div>I use the default reactor which should come down to the epoll one.<br></div><div><br></div>I'll try to hack up the addwriter, it shouldn't be that hard to for just that application.<br><br>Thank you,<br><br>

Killian<br>
</div><div class="gmail_extra"><div><div class="h5"><br><br><div class="gmail_quote">On 7 May 2014 16:11,  <span dir="ltr"><<a href="mailto:exarkun@twistedmatrix.com" target="_blank">exarkun@twistedmatrix.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>On 01:47 pm, <a href="mailto:killiands@gmail.com" target="_blank">killiands@gmail.com</a> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hello everybody,<br>
<br>
I sometimes see the following error logged by a twisted application, it<br>
only happens sporadically and I cannot even reproduce when trying to<br>
re-execute the exact sequence of those failures. So giving an SSCCE is<br>
quite impossible for now (sorry). Given this trace it's also hard to find<br>
what was actually called/executed.<br>
</blockquote>
<br></div>
I've seen something like this with a somewhat old version of Twisted and a custom reactor.  I never tracked down the cause.<br>
<br>
What version of Twisted are you using, what platform are you on, and what reactor are you using?<br>
<br>
Another useful bit of debug information would be to hack up the reactor's `addWriter` method to do a check of the argument.  The call stack at *that* point (when the argument is a Port) is more interesting than the call stack at the point where `doWrite` is called.<br>



<br>
Jean-Paul<br>
<br>
______________________________<u></u>_________________<br>
Twisted-Python mailing list<br>
<a href="mailto:Twisted-Python@twistedmatrix.com" target="_blank">Twisted-Python@twistedmatrix.<u></u>com</a><br>
<a href="http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python" target="_blank">http://twistedmatrix.com/cgi-<u></u>bin/mailman/listinfo/twisted-<u></u>python</a><br>
</blockquote></div><br><br clear="all"><br></div></div><span class="HOEnZb"><font color="#888888">-- <br>Killian De Smedt<br>mobile: <a href="tel:%2B32%20486%2F825%20951" value="+32486825951" target="_blank">+32 486/825 951</a><br>

mail: <a href="mailto:killiands@gmail.com" target="_blank">killiands@gmail.com</a>
</font></span></div>
</blockquote></div><br><br clear="all"><br>-- <br>Killian De Smedt<br>mobile: +32 486/825 951<br>mail: <a href="mailto:killiands@gmail.com" target="_blank">killiands@gmail.com</a>
</div>