Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gh-116515: Clear thread-local state before tstate_delete_common() #116517

Merged
merged 1 commit into from
Mar 11, 2024

Conversation

colesbury
Copy link
Contributor

@colesbury colesbury commented Mar 8, 2024

This moves current_fast_clear() up so that the current thread state is NULL while running tstate_delete_common().

This doesn't fix any bugs, but it means that we are more consistent that _PyThreadState_GET() != NULL means that the thread is "attached".

This moves current_fast_clear() up so that the current thread state is
NULL while running tstate_delete_common().
@colesbury colesbury added skip news 🔨 test-with-buildbots Test PR w/ buildbots; report in status section labels Mar 8, 2024
@bedevere-bot
Copy link

🤖 New build scheduled with the buildbot fleet by @colesbury for commit 4f541ef 🤖

If you want to schedule another build, you need to add the 🔨 test-with-buildbots label again.

Copy link
Member

@ericsnowcurrently ericsnowcurrently left a comment

Choose a reason for hiding this comment

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

LGM

I could swear that didn't work before! 😄 I'm guessing a few things have shifted around with the no-gil work that sorted out the other inconsistencies. Thanks for taking care of this.

(I'm assuming CI doesn't spoil the mood by disproving this fix.)

@colesbury
Copy link
Contributor Author

!buildbot debian root

@bedevere-bot
Copy link

🤖 New build scheduled with the buildbot fleet by @colesbury for commit 4f541ef 🤖

The command will test the builders whose names match following regular expression: debian root

The builders matched are:

  • AMD64 Debian root PR

@colesbury colesbury merged commit 9f983e0 into python:main Mar 11, 2024
120 checks passed
@colesbury colesbury deleted the gh-116515-delete-current branch March 11, 2024 19:14
adorilson pushed a commit to adorilson/cpython that referenced this pull request Mar 25, 2024
…() (python#116517)

This moves `current_fast_clear()` up so that the current thread state is
`NULL` while running `tstate_delete_common()`.

This doesn't fix any bugs, but it means that we are more consistent that
`_PyThreadState_GET() != NULL` means that the thread is "attached".
diegorusso pushed a commit to diegorusso/cpython that referenced this pull request Apr 17, 2024
…() (python#116517)

This moves `current_fast_clear()` up so that the current thread state is
`NULL` while running `tstate_delete_common()`.

This doesn't fix any bugs, but it means that we are more consistent that
`_PyThreadState_GET() != NULL` means that the thread is "attached".
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants