Skip to content

gh-135641: Fix flaky test_capi.test_lock_two_threads test case #135642

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

colesbury
Copy link
Contributor

@colesbury colesbury commented Jun 17, 2025

The mutex may have the _Py_HAS_PARKED bit set in rare cases.

The mutex may have the _Py_HAS_PARKED bit set in rare cases.
@colesbury colesbury requested a review from mpage June 17, 2025 20:37
@colesbury colesbury added skip news needs backport to 3.13 bugs and security fixes needs backport to 3.14 bugs and security fixes labels Jun 17, 2025
@bedevere-app bedevere-app bot added awaiting core review tests Tests in the Lib/test dir labels Jun 17, 2025
Comment on lines +60 to +62
// gh-135641: in rare cases the lock may still have `_Py_HAS_PARKED` set
// (m->_bits == 3) due to bucket collisions in the parking lot hash table
// between this mutex and the `test_data.done` event.
Copy link
Contributor

Choose a reason for hiding this comment

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

Are there any consequences of this being set incorrectly? I think another solution, though much more invasive, might be to move num_waiters from Bucket onto wait_entry.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting core review needs backport to 3.13 bugs and security fixes needs backport to 3.14 bugs and security fixes skip news tests Tests in the Lib/test dir
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants