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

Make cache and values fully thread-safe #9158

Merged
merged 1 commit into from
Nov 21, 2023

Conversation

joshcooper
Copy link
Contributor

@joshcooper joshcooper commented Nov 16, 2023

Not locking the default initialization can lead to race-conditions.

I don't think we can switch to Concurrent::Map, and it's compute_if_absent
method, because insertion order won't be maintained. So synchronize the long
way.

ref: ruby-concurrency/concurrent-ruby#970
Co-authored-by: Maciej Mensfeld [email protected]
resolves #8951

@joshcooper joshcooper requested a review from a team as a code owner November 16, 2023 22:09
Not locking the default initialization can lead to race-conditions.

I don't think we can switch to Concurrent::Map, and it's compute_if_absent
method, because insertion order won't be maintained. So synchronize the long
way.

ref: ruby-concurrency/concurrent-ruby#970
Co-authored-by: Maciej Mensfeld <[email protected]>
resolves puppetlabs#8951
@joshcooper joshcooper added bug Something isn't working triaged Jira issue has been created for this and removed triaged Jira issue has been created for this labels Nov 21, 2023
@joshcooper joshcooper merged commit 4e6aa1f into puppetlabs:7.x Nov 21, 2023
12 checks passed
@joshcooper joshcooper deleted the threadsafe_initialization branch November 22, 2023 06:18
@joshcooper joshcooper removed the triaged Jira issue has been created for this label Nov 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants