[Twisted-Python] doWrite called on a twisted.internet.tcp.Port

Glyph glyph at twistedmatrix.com
Fri Aug 28 23:28:49 MDT 2015


> On Aug 28, 2015, at 12:23, Jason Kane <jason.w.kane at gmail.com> wrote:
> 
> https://twistedmatrix.com/trac/ticket/4759 -- I tried to post as a
> comment in the Trac ticket but "SpamBayes determined spam probability
> of 93.78%".

I've retrained the spam filter so hopefully you won't have this issue in the future.  I do make the point of training spambayes every day and we have few false positives like this - sorry about that!  If it makes you feel any better it properly rejected about 30 spams per one message of yours it rejected ;-).

> Same issue but w/Linux; I've been hacking around at it for a bit and
> found a few things that might be helpful.  I am on old twisted
> (12.1.0) using a backported protocols.memcache so this could be
> self-inflicted.
> 
> Inside epollreactor doPoll() I added sanity checks to log when
> _poller.poll() gives us an event flagged for READ on a fd that is
> _not_ in self._reads (and similarly with writes).  Low and behold,
> gobs of hits.  Unexpected.
> 
> So I took a closer look.  It appears to me that _epoll.epoll() is
> emitting events that are outside of the flags that epollreactor
> carefully registers.  Filtering them out in doPoll seems to avoid this
> particular traceback but it also breaks the world.  At least in my
> system this appears to be the expected behavior.
> 
> So (to restate and summarize) asserting on addWriter() doesn't do
> anything because the Port was added by addReader().  Despite only
> being in _reads() and being registered with _epoll.EPOLLIN, doPoll()
> is getting write events which it happily passes through to
> _doReadOrWrite which checks the event flag, sees it as a _POLL_OUT and
> tries to write it.
> 
> I'll try the obvious (upgrade twisted to current) and see what happens.
> 
> [[https://gist.github.com/jason-kane/18f1516d7c1ef381b35e|Gist of my
> diagnostic]]

Would you mind re-posting this to a comment, as it should work now?  If you have more problems with the spam filter I'll post it myself and credit you.

-glyph

-------------- next part --------------
An HTML attachment was scrubbed...
URL: </pipermail/twisted-python/attachments/20150829/10ed8b37/attachment-0002.html>


More information about the Twisted-Python mailing list