Skip to content

[WIP] bpo-33966, multiprocessing: Fix another handle leak#7965

Closed
vstinner wants to merge 1 commit intopython:masterfrom
vstinner:spawn_close_source
Closed

[WIP] bpo-33966, multiprocessing: Fix another handle leak#7965
vstinner wants to merge 1 commit intopython:masterfrom
vstinner:spawn_close_source

Conversation

@vstinner
Copy link
Copy Markdown
Member

@vstinner vstinner commented Jun 27, 2018

When using a pool of processes on Windows, if the worker is
terminated quickly, handles created by DupHandle() on
reduction.dump() can remain open in the parent process causing a
handles leak.

Use a different strategy in the case: keep the handle open in the
parent process for the lifetime of the worker, and the parent becomes
responsible to close the handle when the worker completes.

https://bugs.python.org/issue33966

When using a pool of processes on Windows, if the worker is
terminated quickly, handles created by DupHandle() on
reduction.dump() can remain open in the parent process causing a
handles leak.

Use a different strategy in the case: keep the handle open in the
parent process for the lifetime of the worker, and the parent becomes
responsible to close the handle when the worker completes.
@vstinner
Copy link
Copy Markdown
Member Author

This change tries to fix https://bugs.python.org/issue33966 but test_wait() hangs with the change. I'm working on a different approach.

@vstinner
Copy link
Copy Markdown
Member Author

I abandon this change because it changes the semantics: PR #7966 is a simpler and safer approach.

@vstinner vstinner closed this Jun 27, 2018
@vstinner vstinner deleted the spawn_close_source branch June 27, 2018 12:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants