[Twisted-Python] Silencing PotentialZombieWarning
Hi All, I'm working on a multi-platform (win32 and os x) wx + Twisted app, where I've found the best solution is to run both in a separate thread - the main thread is wx, and the other is Twisted. It basically works like a charm (though I'd be interested in hearing about other approaches. I've also played with wxreactor way back, but didn't find it as stable). Because I spawn a few processes (using spawnProcess), and must run my reactor with installSignalHandlers=0, I get PotentialZombieWarning errors every time I spawn. Now, I handle reaping of my processes manually for various reasons, and also install my own signal handlers (in the main thread; I also pass clearSigInt=False to wx). Is there any way I can silence these warnings? Thanks, Reza -- Reza Lotun Senior Software Engineer GetPeer Limited reza@getpeer.com
On Thu, 6 Nov 2008 14:31:44 +0000, Reza Lotun <reza@getpeer.com> wrote:
Hi All,
I'm working on a multi-platform (win32 and os x) wx + Twisted app, where I've found the best solution is to run both in a separate thread - the main thread is wx, and the other is Twisted. It basically works like a charm (though I'd be interested in hearing about other approaches. I've also played with wxreactor way back, but didn't find it as stable).
Because I spawn a few processes (using spawnProcess), and must run my reactor with installSignalHandlers=0, I get PotentialZombieWarning errors every time I spawn. Now, I handle reaping of my processes manually for various reasons, and also install my own signal handlers (in the main thread; I also pass clearSigInt=False to wx). Is there any way I can silence these warnings?
Sure. See the Python documentation for warnings.filterwarnings. Jean-Paul
Thanks Jean-Paul, I didn't know about the warnings module! Cheers, Reza On Thu, Nov 6, 2008 at 2:44 PM, Jean-Paul Calderone <exarkun@divmod.com> wrote:
Sure. See the Python documentation for warnings.filterwarnings.
Jean-Paul
_______________________________________________ Twisted-Python mailing list Twisted-Python@twistedmatrix.com http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
-- Reza Lotun Senior Software Engineer GetPeer Limited reza@getpeer.com
Reza Lotun wrote:
I'm working on a multi-platform (win32 and os x) wx + Twisted app, where I've found the best solution is to run both in a separate thread - the main thread is wx, and the other is Twisted. It basically works like a charm (though I'd be interested in hearing about other approaches. I've also played with wxreactor way back, but didn't find it as stable).
I'd be interested to know what wxreactor symptoms of non-stability you saw. A few months ago, the wxreactor apps wxdemo.py and wxacceptance.py on ubuntu worked, but if I added a file dialog to wxacceptance.py, invoking the file dialog caused the application to hang. In my most recent experiments, wxdemo.py just hangs but wxacceptance.py works fine, even with the addition of a file dialog -- presumably due to some recent change in wx, since wxreactor has not been modified recently. The environment I'm using is: * ubuntu hardy, fully updated * Python 2.5.2 * wxPython 2.8.9.1-0 (python-wxgtk2.8 from http://apt.wxwidgets.org/) * Twisted svn trunk rev 25323. I've attached an example (wxacceptancemod.py) that has the file dialog that used to cause the lock-up, sets the helloWorld loop interval to 4 seconds, and closes the gui window immediately when it receives the DoExit event (by calling self.Show(False)) -- a friendlier behavior than the original wxacceptance.py, which leaves the gui window hanging until the last reactor iteration completes (kinda misses the point of being asynchronous ;), although this only becomes noticeable if the helloWorld loop interval is set to more than a second or two. Interestingly, wxdemo.py works if the helloWorld loop from wxacceptance.py is added to it, and wxacceptance.py ceases to work if the callLater loop is removed. The looping interval used is arbitrary, so it seems the reactor stack needs to stay loaded with something or it hangs. Although it's not pretty, I don't mind adding a non-printing callLater loop to my code so that wxreactor works, but of course it would be nice to know what's going on. ;) Do others see these behaviors if you run these examples? Steve
Stephen Waterbury wrote:
A few months ago, the wxreactor apps wxdemo.py and wxacceptance.py on ubuntu worked ...
I meant "worked on ubuntu", not "on ubuntu worked" -- the examples are in twisted's doc/core/examples, nothing unique to ubuntu. ;) Steve
participants (3)
-
Jean-Paul Calderone -
Reza Lotun -
Stephen Waterbury