Message 320528 - Python tracker (original) (raw)

Sorry, it's reduce_pipe_connection(), not reduce_connection().

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()?

reduce_pipe_connection() creates a DupHandle object which duplicates the handle, and it's detach() method closes the handle.

The race condition is that sometimes the pool terminates a worker (worker() function of multiprocessing.pool) before the worker has time to close the duplicated handle.

The handle is closed by: