Skip to content

Fix size assertion in concurrent set resizing #13934

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

Merged

Conversation

peterzhu2118
Copy link
Member

@peterzhu2118 peterzhu2118 commented Jul 17, 2025

Since we resize when prev_size > set->capacity / 2, it's possible that prev_size == set->capacity / 2, so we need to change the assertion in concurrent_set_try_resize_without_locking to be new_set->size <= new_set->capacity / 2.

Since we resize when `prev_size > set->capacity / 2`, it's possible that
`prev_size == set->capacity / 2`, so we need to change the assertion in
concurrent_set_try_resize_without_locking to be
`new_set->size <= new_set->capacity / 2`.
@peterzhu2118 peterzhu2118 requested a review from jhawthorn July 17, 2025 16:57
Copy link

launchable-app bot commented Jul 17, 2025

Tests Failed

✖️no tests failed ✔️62113 tests passed(1 flake)

@peterzhu2118 peterzhu2118 merged commit dafc4e1 into ruby:master Jul 18, 2025
92 of 94 checks passed
@peterzhu2118 peterzhu2118 deleted the concurrent-set-find-insert-resize-race branch July 18, 2025 14:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant