Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork32.4k
Open
Description
Bug report
When running./python -E -m test --timeout=2700 -R3:3 -u-cpu -j40 test_free_threading.test_monitoring -F
, I get a failure every ~50-100 test runs:
0:00:36 load avg: 122.12 [ 55/1] test_free_threading.test_monitoring failed (reference leak)beginning 6 repetitions. Showing number of leaks (. for 0 or less, X for 10 or more)123:456XX. 243test_free_threading.test_monitoring leaked [2, 4, 3] memory blocks, sum=9
I think the issue is that we rely onThread.is_alive()
instead of joining the threads. I think there are still some objects that may not be freed until the thread is joined (like the handle):
cpython/Lib/test/test_free_threading/test_monitoring.py
Lines 65 to 77 incb59eae
whileTrue: | |
any_alive=False | |
fortinthreads: | |
ift.is_alive(): | |
any_alive=True | |
break | |
ifnotany_alive: | |
break | |
self.during_threads() | |
self.after_test() |