[Twisted-Python] doWrite called on a twisted.internet.tcp.Port
![](https://secure.gravatar.com/avatar/e44e6f4a9fb3f6cb71bb38899e7e9356.jpg?s=120&d=mm&r=g)
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%". 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]]
![](https://secure.gravatar.com/avatar/e1554622707bedd9202884900430b838.jpg?s=120&d=mm&r=g)
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 ;-).
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
![](https://secure.gravatar.com/avatar/e1554622707bedd9202884900430b838.jpg?s=120&d=mm&r=g)
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 ;-).
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
participants (2)
-
Glyph
-
Jason Kane