[issue31233] socketserver.ThreadingMixIn leaks running threads after server_close()

STINNER Victor report at bugs.python.org
Thu Oct 19 09:32:28 EDT 2017


STINNER Victor <victor.stinner at gmail.com> added the comment:

The current code leaks memory since it never clears threads which completed. We need a cleanup function similar to ForkingMixIn.collect_children() which is called by handle_timeout() and service_actions().

We can check if a thread is alive: thread.is_alive(), to decide to remove it or not.

Moreover, maybe we should keep a list of weak references?

----------

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


More information about the Python-bugs-list mailing list