]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.12] gh-127586: multiprocessing.Pool does not properly restore blocked signals...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Sun, 29 Dec 2024 19:02:59 +0000 (20:02 +0100)
committerGitHub <noreply@github.com>
Sun, 29 Dec 2024 19:02:59 +0000 (11:02 -0800)
commitbe7314ffac270bf2a52eeb4d685da631b405c973
tree2a1fbaacbdd5c57f676037f26096f122feb81412
parent3a726be127b38ad568b100176c2de3112ae07b9d
[3.12] gh-127586: multiprocessing.Pool does not properly restore blocked signals (try 2) (GH-128011) (#128299)

gh-127586: multiprocessing.Pool does not properly restore blocked signals (try 2) (GH-128011)

Correct pthread_sigmask in resource_tracker to restore old signals

Using SIG_UNBLOCK to remove blocked "ignored signals" may accidentally
cause side effects if the calling parent already had said signals
blocked to begin with and did not intend to unblock them when
creating a pool. Use SIG_SETMASK instead with the previous mask of
blocked signals to restore the original blocked set.
(cherry picked from commit aeb9b65aa26444529e4adc7d6e5b0d3dd9889ec2)

Co-authored-by: Stephen Hansen <stephen.paul.hansen@gmail.com>
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
Lib/multiprocessing/resource_tracker.py
Lib/test/_test_multiprocessing.py
Misc/NEWS.d/next/Library/2024-12-03-20-28-08.gh-issue-127586.zgotYF.rst [new file with mode: 0644]