]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.13] gh-87744: fix waitpid race while calling send_signal in asyncio (GH-121126...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Mon, 1 Jul 2024 05:11:47 +0000 (07:11 +0200)
committerGitHub <noreply@github.com>
Mon, 1 Jul 2024 05:11:47 +0000 (05:11 +0000)
commitd481d4b7676f2e5d33465ca691346f69af655b24
treef1803cc7ea7152dc8af1ef30728f30fdedb66966
parentaf89237c9c1bdcda7915ea195b279734f7ebddf2
[3.13] gh-87744: fix waitpid race while calling send_signal in asyncio (GH-121126) (#121194)

gh-87744: fix waitpid race while calling send_signal in asyncio (GH-121126)

asyncio earlier relied on subprocess module to send signals to the process, this has some drawbacks one being that subprocess module unnecessarily calls waitpid on child processes and hence it races with asyncio implementation which internally uses child watchers. To mitigate this, now asyncio sends signals directly to the process without going through the subprocess on non windows systems. On Windows it fallbacks to subprocess module handling but on windows there are no child watchers so this issue doesn't exists altogether.

(cherry picked from commit bd473aa598c5161521a7018896dc124728214a6c)

Co-authored-by: Kumar Aditya <kumaraditya@python.org>
Lib/asyncio/base_subprocess.py
Lib/test/test_asyncio/test_subprocess.py
Misc/NEWS.d/next/Library/2024-06-29-05-08-59.gh-issue-87744.rpF6Jw.rst [new file with mode: 0644]