]> granicus.if.org Git - python/commit
bpo-33929: multiprocessing: fix handle leak on race condition (GH-7921)
authorVictor Stinner <vstinner@redhat.com>
Wed, 27 Jun 2018 09:40:24 +0000 (11:40 +0200)
committerGitHub <noreply@github.com>
Wed, 27 Jun 2018 09:40:24 +0000 (11:40 +0200)
commit2cc9d21fffb8146d30e6fb4221e32410ba4b4ab7
treea64c215f6670bd22695f9d1855956aa3d57a87e1
parentf15f66d275d1166839312c9ff3a67c00b486c7d6
bpo-33929: multiprocessing: fix handle leak on race condition (GH-7921)

Fix a race condition in Popen of
multiprocessing.popen_spawn_win32. The child process now duplicates
the read end of pipe instead of "stealing" it.

Previously, the read end of pipe was "stolen" by the child process,
but it leaked a handle if the child process had been terminated
before it could steal the handle from the parent process.
Lib/multiprocessing/popen_spawn_win32.py
Lib/multiprocessing/reduction.py
Lib/multiprocessing/spawn.py
Misc/NEWS.d/next/Library/2018-06-26-02-09-18.bpo-33929.OcCLah.rst [new file with mode: 0644]