STINNER Victor added the comment:

> In this case all started threads left dangling and make MemotyError even more 
> probably

Oh, I didn't know that. Good catch.

test_support_start_threads.patch looks good to me and it looks like a nice 
enhancement.

But would it be possible to emit a warning if a thread hangs?

For example, try to join with a timeout of 60 seconds, and then display a 
warning, and retry with a timeout of 120 seconds, then display a second 
warning, etc.

Maybe we may even give up after a timeout (ex: 5 minutes, or 15 minutes, it's 
up to you). An exception must be raised in this case. You can use 
faulthandler.dump_traceback() to display the traceback of all threads in this 
case.

I hope that my concern is more theorical, but it would reduce the duration of 
tests when the test suite is stuck (which is quite common), and so being able 
to test more changesets per day.

--

I noticed that under low memory condition, some tests hang because Python 
doesn't handle notify the "parent thread" that the "child thread" fails to 
start. So the parent thread is stuck and nothing happens. Well, I'm not sure 
that it's related to this issue. At least, test_support_start_threads.patch 
doesn't help.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue23799>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to