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-121546: Disable contextvar caching on free-threading build #121740

Merged
merged 2 commits into from
Jul 15, 2024

Conversation

Fidget-Spinner
Copy link
Member

@Fidget-Spinner Fidget-Spinner commented Jul 14, 2024

I tested this by running the repros in the issue on a TSAN build for 2-3 minutes each. No races reported.

Copy link
Contributor

@colesbury colesbury left a comment

Choose a reason for hiding this comment

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

I think this is the right approach for now, especially for 3.13. LGTM, with two comments:

  • There's an unused variable warning (see comment below)
  • Consider adding the #ifndef guards in struct _pycontextvarobject around the cache fields as well to make it more clear that they are not used in the free-threaded build.

Python/context.c Show resolved Hide resolved
@Fidget-Spinner Fidget-Spinner merged commit e904300 into python:main Jul 15, 2024
34 checks passed
@miss-islington-app
Copy link

Thanks @Fidget-Spinner for the PR 🌮🎉.. I'm working now to backport this PR to: 3.13.
🐍🍒⛏🤖

@Fidget-Spinner Fidget-Spinner deleted the disable_cached_contextvars branch July 15, 2024 18:58
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jul 15, 2024
@bedevere-app
Copy link

bedevere-app bot commented Jul 15, 2024

GH-121808 is a backport of this pull request to the 3.13 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.13 bugs and security fixes label Jul 15, 2024
colesbury pushed a commit that referenced this pull request Jul 15, 2024
…H-121740) (#121808)

gh-121546: Disable contextvar caching on free-threading build (GH-121740)
(cherry picked from commit e904300)

Co-authored-by: Ken Jin <[email protected]>
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.

2 participants