On Wed, 27 May 2009 15:08:49 +0200, Lars Ivar Igesund <lars...@gmail.com> wrote: >Hi! > >I have an issue where the reactor calls the callback from a different >thread than the one the reactor is running in.
Generally speaking, the only callbacks the reactor invokes are protocol methods (like dataReceived and connectionLost) and timed events (things you pass to reactor.callLater). It always calls these in the thread it is running in. What callbacks are you seeing be invoked in the "wrong" thread? > [snip] > >What can cause this and how may I debug it? AFAIK, PyFit does not use >twisted or threading at all, and we only have two simple background >threads our selves in addition to the one running the trap deamon. The most likely explanation is that your code (perhaps by way of PyFit, I'm not sure -- I've never used PyFit) is calling a Twisted API from a thread other than the reactor thread. So, examine all the places you call Twisted APIs (including APIs in twistedsnmp which may call Twisted APIs) and make sure they're only run in the reactor thread. Jean-Paul _______________________________________________ Twisted-Python mailing list Twisted-Python@twistedmatrix.com http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python