[3.13] gh-134698: Hold a lock when the thread state is detached in ssl (GH-134724)#137126
[3.13] gh-134698: Hold a lock when the thread state is detached in ssl (GH-134724)#137126gpshead merged 1 commit intopython:3.13from
Conversation
… in `ssl` (pythonGH-134724) Lock when the thread state is detached. (cherry picked from commit e047a35) Co-authored-by: Peter Bierma <[email protected]> Co-authored-by: Gregory P. Smith <[email protected]>
There was a problem hiding this comment.
When backports are not automated I always struggle to see which was automated and which wasn't. I tried to compare it with the 3.14 backport and it seems that the changes are identical. There is one place when I'm unusure about the usage of _Py_SSL_FIX_ERRNO.
I'll ask Peter to have a look as he wrote the original PR.
|
|
||
| PySSL_END_ALLOW_THREADS_S(pw_info->thread_state); | ||
| pw_info->thread_state = PyThreadState_Swap(pw_info->thread_state); | ||
| _PySSL_FIX_ERRNO; |
There was a problem hiding this comment.
I don't know if this one is needed because I don't know if the callback mechanism could set an errno that is not propagated so I'm ok to keep it.
There was a problem hiding this comment.
The former PySSL_END_ALLOW_THREADS_S macro that this replaces included the _PySSL_FIX_ERRNO macro, but I think you're right that it's not needed. I'm not worried about breakage because _PySSL_FIX_ERRNO only applies to Windows debug builds anyway.
Lock when the thread state is detached.
(cherry picked from commit e047a35) ... or 3.14 backport fd565fd
backport via the pending 3.14 backport #137107