Message349225
The root cause for the reference leak is the global set threading._shutdown_locks. It contains Thread._tstate_lock locks of non-daemon threads. If a non-daemon thread terminates and no other thread joins the terminated thread, the _tstate_lock remains in threading._shutdown_locks forever.
I could imagine that a long running server could accumulate many locks in threading._shutdown_locks over time. Therefore the leak should be fixed.
There are probably several ways to deal with this issue. A straight forward approach is to discard the lock from within `tstate->on_delete` hook, that is function "void release_sentinel(void *)" in _threadmodule.c. Pull request (GH-15175) implements this idea. Eventually I should add another C-Python specific test-case to the PR. |
|
Date |
User |
Action |
Args |
2019-08-08 08:47:16 | anselm.kruis | set | recipients:
+ anselm.kruis |
2019-08-08 08:47:16 | anselm.kruis | set | messageid: <1565254036.46.0.124559684376.issue37788@roundup.psfhosted.org> |
2019-08-08 08:47:16 | anselm.kruis | link | issue37788 messages |
2019-08-08 08:47:16 | anselm.kruis | create | |
|