Detecting Remaining Thread

Damian Johnson atagar1 at gmail.com
Wed Jan 19 12:40:29 EST 2011


Hi, I've been trying to track down a familiar concurrency problem
without any success:
Unhandled exception in thread started by
Error in sys.excepthook:

Original exception was:

I realize that this is due to a background thread still being alive
and kicking when the application terminates (ie, a missing join() on a
helper thread). However, threading.enumerate() is reporting that
nothing except for the main thread is running at that point:
1/19/2011 09:30:41 [INFO] Arm is shutting down. Remaining threads:
[<_MainThread(MainThread, started -1217079616)>]

What other methods are there for troubleshooting this sort of issue?
I've triple checked that my threads are daemons and joined when
quitting but I must be missing something...

As would be expected of a timing issue, this happens intermittently
(1/5 of the time) and goes away if I add a short sleep at the end. Any
help would be much appreciated. Thanks! -Damian



More information about the Python-list mailing list