On Jan 4, 2008 2:46 AM, Guido van Rossum <[EMAIL PROTECTED]> wrote:

> See http://bugs.python.org/issue1731. Should we consider it safe to
> backport r57216 to 2.5.2? This is Thomas Wouters's code to disable
> spurious tracebacks when daemon threads die. We're running some 2.4
> apps with (a variant of) this at Google that get many 1000s of
> invocations a day, so I'm pretty confident that it works.
>

I'm also pretty confident it works, although it isn't really guaranteed to
catch *all* such situations. No reason not to backport it, just a remark
about how it checks to see if Python is shutting down. It is, however,
incredibly unlikely '_sys' won't be gone when we check for it if the
exception is indeed a spurious one. What could happen is that a legitimate
exception happens right before interpreter shutdown, then a thread switch
occurs before Python tries to report the exception, the interpreter exits,
and then the daemonic thread starts to report its exception. The only way to
catch that is to do the 'are we exiting' check in the C code that does the
actual thread-exception reporting. I'm not sure if it's worth it, as the
timing has to be pretty exact for that to happen, and you wouldn't want to
introduce a bug there; could be years before someone figures it out :P

-- 
Thomas Wouters <[EMAIL PROTECTED]>

Hi! I'm a .signature virus! copy me into your .signature file to help me
spread!
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to