Detecting Remaining Thread

Damian Johnson atagar1 at gmail.com
Wed Jan 19 22:11:22 EST 2011


Disregard, I figured it out. It turns out that the threads spawned by
"thread.start_new_thread" are unreported by threading.enumerate.
Cheers! -Damian

On Wed, Jan 19, 2011 at 9:40 AM, Damian Johnson <atagar1 at gmail.com> wrote:
> 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