[Twisted-Python] Reactor getting stuck in random places on Windows?

Steve Freitas sflist at ihonk.com
Sat Feb 3 00:13:36 EST 2007

I'm writing a Twisted client that uses PB. It seems to be getting stuck
intermittently -- failing to respond to the server's queries. Sometimes
it gets stuck immediately after login, sometimes after it's been running
fine for a while. I'm starting the Twisted client in a terminal window.
What unsticks it in these cases is always a single ^C. Now, sometimes
that spits up an unhandled exception from some place into the log
(stdout) and then it goes on its merry way -- other times it has no
error to report and moves on like nothing happened.

I'm frequently ctrl-C'ing this program as I try my new changes, and
sometimes it takes one to kill it, and sometimes it takes two. Hopefully
this is a clue.

I thought perhaps I had a deferred that was hanging, but in the entire
client, I'm calling addCallback() exactly once -- and it's followed by
an addErrback(), so I don't think the problem is there.

I first noticed this behavior when it was running as a Windows service,
and I thought it may have been related to the necessity of starting the
reactor with calling reactor.run(installSignalHandlers=0) (I didn't yet
see the tip about periodically passing child signals to the reactor),
but it still happens, albeit apparently less often, with a simple

Any ideas would be appreciated.



More information about the Twisted-Python mailing list