[Twisted-Python] interaction problems with wxreactor and conch under linux

Mark Dillavou mlists at line72.net
Tue May 27 12:45:26 MDT 2008

I have a large program that is built using wxpython and twisted in which the
client sends commands through ssh (using conch) to the server.  Under linux
I have found some very strange results. If the user is not doing anything
(i.e. not moving the mouse or doing anything to cause the window to redraw),
then conch seems to stop processing and hang the whole twisted loop.  As
soon as the user moves the mouse, clicks a button, or does something to
cause the window to refresh, then conch immediately starts processing again
and the twisted loop begins calling callbacks again.

I can't seem to reproduce this under windows or osx, and it doesn't seem to
always happen under linux with wxgtk2. I have written a dumb little test
program (attached), that hopefully shows this behavior.  After connecting to
a remote machine, through the gui you can specify a command, hit run command
and the stdout will be displayed.

The console prints out the time from two timers.  One is setup using a
reactor.callLater and another is setup using a wx.Timer.  If a command that
takes a while is run (cat a large file) and you don't move the mouse or do
anything to cause the window to refresh, then you will see that the
callLater callback stops being called (although the wx.Timer callback
continues to be called).  As soon as you move the mouse, the callLater
callback begins firing again, and you'll eventually see the output of your

This is really frustrating since we are using conch to send large commands
or to download/upload large files, and it is common for the user to want to
minimize the program and let it run in the background, but with this bug,
twisted stops responding and the file stops sending until the user does
something to cause the window to redraw.

I'm not that familiar with conch, so maybe i'm doing something completely
wrong in my connection code.  Any critique on it would be nice.

Thank you in advance,
-------------- next part --------------
An HTML attachment was scrubbed...
URL: </pipermail/twisted-python/attachments/20080527/35a82bd5/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: conch_wx.py
Type: text/x-python
Size: 7410 bytes
Desc: not available
URL: </pipermail/twisted-python/attachments/20080527/35a82bd5/attachment-0002.py>

More information about the Twisted-Python mailing list