[New-bugs-announce] [issue32850] Run gc_collect() before complaining about dangling threads

Matthias Urlichs report at bugs.python.org
Thu Feb 15 09:02:32 EST 2018


New submission from Matthias Urlichs <smurf at smurf.noris.de>:

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" thread looks like this:

[<frame at 0x7fe830195768, file '/usr/lib/python3.7/threading.py', line 869, code run>, <frame at 0x7fe828000b38, file '/usr/lib/python3.7/threading.py', line 966, code _bootstrap_inner>, <frame at 0x7fe83018aac8, file '/usr/lib/python3.7/threading.py', line 889, code _bootstrap>]

Thus I propose to check, run gc, check again, and only *then* complain-and-wait. Hence the attached patch for your consideration.

----------
components: Tests
files: gc.patch
keywords: patch
messages: 312206
nosy: smurfix
priority: normal
severity: normal
status: open
title: Run gc_collect() before complaining about dangling threads
type: resource usage
versions: Python 3.7
Added file: https://bugs.python.org/file47445/gc.patch

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue32850>
_______________________________________


More information about the New-bugs-announce mailing list