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

Clean-up use of @suppress_immortalization #125900

Closed
colesbury opened this issue Oct 23, 2024 · 0 comments
Closed

Clean-up use of @suppress_immortalization #125900

colesbury opened this issue Oct 23, 2024 · 0 comments

Comments

@colesbury
Copy link
Contributor

colesbury commented Oct 23, 2024

As a temporary measure, we immortalized a number of objects in the 3.13 free threading build. To work around refleak test failures, we added a @test.support.suppress_immortalization() decorator that suppressed the behavior.

Now that we have deferred reference counting, that behavior is mostly gone and we can get rid of the decorator. We still want to suppress immortalization of code constants in a few places (like compile()), but that logic can be simpler and doesn't have to be exposed to Python.

Linked PRs

colesbury added a commit to colesbury/cpython that referenced this issue Oct 23, 2024
* Remove `@suppress_immortalization` decorator
* Make suppression flag per-thread instead of per-interpreter
* Suppress immortalization in `eval()` to avoid refleaks in three tests
  (test_datetime.test_roundtrip, test_logging.test_config8_ok, and
   test_random.test_after_fork).
* frozenset() is constant, but not a singleton. When run multiple times,
  the test could fail due to constant interning.
colesbury added a commit that referenced this issue Oct 24, 2024
…125901)

* Remove `@suppress_immortalization` decorator
* Make suppression flag per-thread instead of per-interpreter
* Suppress immortalization in `eval()` to avoid refleaks in three tests
  (test_datetime.test_roundtrip, test_logging.test_config8_ok, and
   test_random.test_after_fork).
* frozenset() is constant, but not a singleton. When run multiple times,
  the test could fail due to constant interning.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant