Skip to content

Conversation

colesbury
Copy link
Contributor

@colesbury colesbury commented Feb 13, 2025

  • Use a mutex to avoid potentially returning a non-immortalized string, because immortalization happens after the insertion into the interned dict.

  • Use Py_DECREF() calls instead of Py_SET_REFCNT(s, Py_REFCNT(s) - 2) for thread-safety. This code path isn't performance sensitive, so just use Py_DECREF() unconditionally for simplicity.

…ded build

* Use a mutex to avoid potentially returning a non-immortalized string,
  because immortalization happens after the insertion into the interned
  dict.

* Use `Py_DECREF()` calls instead of `Py_SET_REFCNT(s, Py_REFCNT(s) - 2)`
  for thread-safety. This code path isn't performance sensistive, so
  just use `Py_DECREF()` unconditionally for simplicity.
@colesbury colesbury added skip news 🔨 test-with-refleak-buildbots Test PR w/ refleak buildbots; report in status section topic-free-threading labels Feb 13, 2025
@bedevere-bot
Copy link

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

Results will be shown at:

https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F30617%2Fmerge

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

@colesbury colesbury marked this pull request as ready for review February 14, 2025 00:37
@colesbury colesbury requested review from encukou and mpage February 14, 2025 00:37
Copy link
Contributor

@mpage mpage left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@encukou encukou left a comment

Choose a reason for hiding this comment

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

LGTM! I didn't check if this solves the issue, but it looks like an improvement.

@encukou encukou merged commit b9d2ee6 into python:main Feb 17, 2025
47 checks passed
@colesbury colesbury deleted the gh-129701-intern-common branch February 18, 2025 16:00
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.

4 participants