[issue33966] test_multiprocessing_spawn.WithProcessesTestPool.test_traceback() leaks 4 handles on Windows

STINNER Victor report at bugs.python.org
Tue Jun 26 19:53:31 EDT 2018


STINNER Victor <vstinner at redhat.com> added the comment:

* Pool._repopulate_pool() creates processes with args=(self._inqueue, ...)
* Pool._inqueue is a multiprocessing.queues.SimpleQueue
* Process.__init__() of multiprocessing.popen_spawn_win32 calls reduction.dump(process_obj, to_child) which indirectly contains the SimpleQueue
* A SimpleQueue object contains: self._reader, self._writer = connection.Pipe(duplex=False)
* dump() indirectly calls reduce_connection() (ex: for SimpleQueue._reader) of multiprocessing.connection
* reduce_connection() duplicates the pipe handle

It's unclear to me who is supposed to close the duplicated pipe handles? reduce_connection() creates a "ds = resource_sharer.DupSocket(s)" object, but this object doesn't seem to call CloseHandle()?

----------

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


More information about the Python-bugs-list mailing list