X Tutup
Skip to content

gh-140795: Keep 'err' in local variable in _ssl.c#143275

Merged
colesbury merged 1 commit intopython:mainfrom
colesbury:gh-140795-ssl-err
Dec 31, 2025
Merged

gh-140795: Keep 'err' in local variable in _ssl.c#143275
colesbury merged 1 commit intopython:mainfrom
colesbury:gh-140795-ssl-err

Conversation

@colesbury
Copy link
Copy Markdown
Contributor

@colesbury colesbury commented Dec 29, 2025

The error return code doesn't need to be mutable state on the SSLSocket. This simplifies thread-safety and avoids potential reentrancy issues.

The error return code doesn't need to be mutable state on the SSLSocket.
This simplifes thread-safety and avoids potential reentrancy issues.
@colesbury colesbury added skip news type-refactor Code refactoring (with no changes in behavior) labels Dec 29, 2025
@colesbury colesbury marked this pull request as ready for review December 29, 2025 18:08
@colesbury
Copy link
Copy Markdown
Contributor Author

The motivation here is to refactor out shared state so that we can remove some of the SSLSocket locks.

Copy link
Copy Markdown
Member

@picnixz picnixz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I don't know why self->err is carried over actually.

@colesbury colesbury merged commit 96ab379 into python:main Dec 31, 2025
54 checks passed
@colesbury colesbury deleted the gh-140795-ssl-err branch December 31, 2025 00:45
thunder-coding pushed a commit to thunder-coding/cpython that referenced this pull request Feb 15, 2026
)

The error return code doesn't need to be mutable state on the SSLSocket.
This simplifes thread-safety and avoids potential reentrancy issues.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip news type-refactor Code refactoring (with no changes in behavior)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

X Tutup