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

Attempt to deflake test_concurrent_lazy_init #51

Merged
merged 1 commit into from
Oct 7, 2024
Merged

Attempt to deflake test_concurrent_lazy_init #51

merged 1 commit into from
Oct 7, 2024

Conversation

bcmills
Copy link
Contributor

@bcmills bcmills commented Oct 4, 2024

It turns out that functools.lru_cache is only mostly thread-safe. It guarantees that the underlying data structure will remain coherent during concurrent updates, but does NOT guarantee that the wrapped function will be called at most once per key. That could lead to calls to new_type unexpectedly returning different types for the same index.

Fixes #50.

It turns out that functools.lru_cache is only mostly thread-safe. It
guarantees that the underlying data structure will remain coherent
during concurrent updates, but does NOT guarantee that the wrapped
function will be called at most once per key. That could lead to calls
to new_type unexpectedly returning different types for the same index.

Fixes #50.
@bcmills
Copy link
Contributor Author

bcmills commented Oct 4, 2024

trigger ci

@bcmills
Copy link
Contributor Author

bcmills commented Oct 4, 2024

CI failure is #43, which this PR is not aiming to fix.

@bcmills bcmills merged commit cb530aa into master Oct 7, 2024
4 checks passed
@bcmills bcmills deleted the issue-50 branch October 16, 2024 17:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Flaky failures in test_concurrent_lazy_init
2 participants