]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-87744: fix waitpid race while calling send_signal in asyncio (#121126)
authorKumar Aditya <kumaraditya@python.org>
Mon, 1 Jul 2024 04:47:36 +0000 (10:17 +0530)
committerGitHub <noreply@github.com>
Mon, 1 Jul 2024 04:47:36 +0000 (10:17 +0530)
commitbd473aa598c5161521a7018896dc124728214a6c
tree804fb037a9ee7efed79c9207075179bb2d548100
parent1a84bdc2371ada60c01c72493caba62c9860007b
gh-87744: fix waitpid race while calling send_signal in asyncio (#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.
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]