You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ThreadPoolExecutorTest.test_no_stale_references may hang with GIL disabled #117688
In #114824, I modified test_no_stale_references so that it passes in the --disable-gil build. Unfortunately, that change was not sufficient and the test may still hang once the GIL is actually disabled.
The problem is due to the combination of two issues:
Due to biased reference counting, the destructor for my_object is usually called on the main thread asynchronously (by the eval breaker logic)
The destructor may be called somewhere in the implementation of my_object_collected.wait(). The my_object_collected.wait() implementation holds some of the same locks that my_object_collected.set() also needs. This can lead to deadlock if the timing is unlucky: the my_object_collected.set() call from the weakref callback tries to acquire locks already held by the current thread and deadlocks.
Activity
pythongh-117688: Fix deadlock in test_no_stale_references with GIL di…
Merge branch 'pythongh-117688-test_no_stale_references' into nogil-in…
Merge branch 'pythongh-117688-test_no_stale_references' into nogil-in…
gh-117688: Fix deadlock in test_no_stale_references with GIL disabled (…
pythongh-117688: Fix deadlock in test_no_stale_references with GIL di…