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-117688: Fix deadlock in test_no_stale_references with GIL disabled #117720

Merged
merged 1 commit into from
Apr 15, 2024

Conversation

colesbury
Copy link
Contributor

@colesbury colesbury commented Apr 10, 2024

Check my_object_collected.wait() in a loop to give the main thread a
chance to merge the reference count fields. Additionally, call
my_object_collected.set() in a background thread to avoid deadlocking
when the destructor is called asynchronously via the eval breaker
within the body of of my_object_collected.wait().

@corona10
Copy link
Member

Oh, I will take a look at it by tomorrow :) I need to read the details.

@corona10 corona10 self-assigned this Apr 11, 2024
@colesbury
Copy link
Contributor Author

Thanks!

Copy link
Member

@corona10 corona10 left a comment

Choose a reason for hiding this comment

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

LGTM,
It is a complicated situation, and I can not find a better solution.

@colesbury colesbury merged commit 520cf21 into python:main Apr 15, 2024
37 checks passed
@colesbury colesbury deleted the gh-117688-test_no_stale_references branch April 15, 2024 16:54
diegorusso pushed a commit to diegorusso/cpython that referenced this pull request Apr 17, 2024
…sabled (python#117720)

Check `my_object_collected.wait()` in a loop to give the main thread a
chance to merge the reference count fields. Additionally, call
`my_object_collected.set()` in a background thread to avoid deadlocking
when the destructor is called asynchronously via the eval breaker
within the body of of `my_object_collected.wait()`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants