[issue42752] multiprocessing Queue leaks a file descriptor associated with the pipe writer (#33081 still a problem)

Alex Orange report at bugs.python.org
Thu Dec 31 21:36:59 EST 2020


Alex Orange <crazycasta at gmail.com> added the comment:

Well, having not heard anything I decided to just make a patch and throw it up. Here it is. This includes a test that will fail with the old version and passes once patched as well as the patch to the queue code itself.

Worth noting, the CleanExchange class is used because simpler things like using a closure to pass the exchange mechanism hold a reference to the Queue one way or another that is difficult/impossible to kill. This is because the intermediate thread mechanisms hold a reference to all the arguments that are passed to the run function. CleanExchange allows an indirect reference to be passed and for the reference to Queue to be None'd out.

----------
keywords: +patch
Added file: https://bugs.python.org/file49713/queue_close_write.patch

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


More information about the Python-bugs-list mailing list