]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-127586: properly restore blocked signals in resource_tracker.py (GH-127587)
authorStephen Hansen <stephen.paul.hansen@gmail.com>
Sun, 15 Dec 2024 19:53:22 +0000 (14:53 -0500)
committerGitHub <noreply@github.com>
Sun, 15 Dec 2024 19:53:22 +0000 (11:53 -0800)
commit46006a1b355f75d06c10e7b8086912c483b34487
tree03efaaf9e69c71002d4babf7e76e028a5a406f80
parent7b8bd3b2b81f4aca63c5b603b56998f6b3ee2611
gh-127586: properly restore blocked signals in resource_tracker.py (GH-127587)

* 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.

* Adding resource_tracker blocked signals test

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]