]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.14] gh-134698: Hold a lock when the thread state is detached in `ssl` (GH-134724...
authorGregory P. Smith <68491+gpshead@users.noreply.github.com>
Tue, 7 Oct 2025 18:49:22 +0000 (11:49 -0700)
committerGitHub <noreply@github.com>
Tue, 7 Oct 2025 18:49:22 +0000 (18:49 +0000)
commite51acb3fa6d752dcbdf659f3279cb3026216c9b8
treee1fbed2aa68f4a2e854ce2cda6fcf2e19dd9a9be
parented9c0c3cbe9505eca07f2cb6fb38bed63a56b359
[3.14] gh-134698: Hold a lock when the thread state is detached in `ssl` (GH-134724) (GH-137107)

* [3.14] gh-134698: Hold a lock when the thread state is detached in `ssl` (GH-134724)

Lock when the thread state is detached.
(cherry picked from commit e047a35b23c1aa69ab8d5da56f36319cec4d36b8)

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
* Only lock the SSL context, not the SSL socket.

This solves a deadlock when a socket is blocked while waiting on data,
which ended up causing a major regression in 3.13.6 (see gh-137583).

---------

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Lib/test/test_ssl.py
Misc/NEWS.d/next/Library/2025-05-26-10-52-27.gh-issue-134698.aJ1mZ1.rst [new file with mode: 0644]
Modules/_ssl.c
Modules/_ssl/debughelpers.c