[Twisted-Python] 2 threads questions

Jonathan Vanasco twisted-python at 2xlp.com
Tue Mar 27 10:03:44 MDT 2007


i have a threaded daemon which occasionally hangs because of some  
stalling in the threadpool

a-	whats the best way to shut it down ?
	attempts to ctl-c / kill it seem to be interpreted by a random  
thread.  the only way to kill it is a kill -9
	the python threading docs said that was the expected behavior, and  
that it could be avoided by using signal.
	I figured twisted might have something in it already to handle  
shutting down a reactor with active threads.  the threads docs for  
twisted are a little light.

b-	i'm trying to figure out the cause of the stalling in the threadpool
	from the status messages i'm printing, I'm seeing the main python  
code firing fine, but the threadpool is just stuck - nothing  
dispatched to it seems to clean up
	i wonder if it might be related to a few tickets i've seen
		http://twistedmatrix.com/trac/ticket/2448
		http://trac.edgewall.org/ticket/3923

	i'm trying to figure out a way to reliably test this.  i've got a  
ssh manhole running via conch ( and instructions from the twisted book )
	can anyone suggest a good way to test and try to debug what is going  
on?  i'm extremely uninformed when it comes to python threads.





More information about the Twisted-Python mailing list