[issue32850] Run gc_collect() before complaining about dangling threads

2018-03-27 Thread Nathaniel Smith
Nathaniel Smith added the comment: @Victor: So to make sure I understand, the point of the check is to complain about reference cycles involving thread objects, because when those happen in the stdlib you consider them bugs? -- ___

[issue32850] Run gc_collect() before complaining about dangling threads

2018-03-27 Thread Matthias Urlichs
Matthias Urlichs added the comment: > It's a deliberate choice. It helped me to find real bugs. For example, I > found a very old reference cycle in socket.create_connection(). Fair enough; I will change the patch to complain before gc'ing. --

[issue32850] Run gc_collect() before complaining about dangling threads

2018-03-27 Thread STINNER Victor
STINNER Victor added the comment: > This is not useful, esp. when the list of referrers to the "dangling" thread > looks like this: (...) I wrote the test.bisect tool to help to debug dangling threads issues. Sadly, sometimes the warning can occur randomly because

[issue32850] Run gc_collect() before complaining about dangling threads

2018-03-27 Thread STINNER Victor
STINNER Victor added the comment: > Lib/test/support/__init__.py::threading_cleanup() complains about dangling > threads even if the reference in question would be cleaned up by the garbage > collector. It's a deliberate choice. It helped me to find real bugs. For

[issue32850] Run gc_collect() before complaining about dangling threads

2018-03-27 Thread Nathaniel Smith
Nathaniel Smith added the comment: Yes, a PR would be better... also, the two versions of the patch appear to be identical? CC'ing Antoine and Victor b/c they seem to have written this dangling_threads checking stuff and I'm not sure I understand it :-). As some extra

[issue32850] Run gc_collect() before complaining about dangling threads

2018-03-27 Thread Christian Heimes
Christian Heimes added the comment: We generally prefer pull requests on github over patches on the bug tracker. Please follow the guidelines for contributing to CPython, https://devguide.python.org/pullrequest/ -- nosy: +christian.heimes

[issue32850] Run gc_collect() before complaining about dangling threads

2018-03-27 Thread Matthias Urlichs
Matthias Urlichs added the comment: Apparently this patch has not been applied yet. Is there a reason for that, besides "it's obviously correct so there must be something wrong with it"? ;-) -- ___ Python tracker

[issue32850] Run gc_collect() before complaining about dangling threads

2018-02-15 Thread Nathaniel Smith
Change by Nathaniel Smith : -- nosy: +ezio.melotti, njs ___ Python tracker ___ ___

[issue32850] Run gc_collect() before complaining about dangling threads

2018-02-15 Thread Matthias Urlichs
Matthias Urlichs added the comment: Upon further consideration (and following the observation that my test cases no longer block for two seconds each after applying the first version of this patch): we do not want to clear the reference to "dangling_threads" since

[issue32850] Run gc_collect() before complaining about dangling threads

2018-02-15 Thread Matthias Urlichs
New submission from Matthias Urlichs : Lib/test/support/__init__.py::threading_cleanup() complains about dangling threads even if the reference in question would be cleaned up by the garbage collector. This is not useful, esp. when the list of referrers to the "dangling"