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

Fix potential race conditions with InMemoryStore accesses #38

Merged
merged 1 commit into from
Jan 7, 2025

Conversation

colinodell
Copy link
Member

This PR introduces a sync.RWMutex to the InMemoryStore, ensuring safe concurrent access to the in-memory slice of users. This change addresses potential race conditions that can arise when multiple goroutines read and modify the slice at the same time.

@colinodell colinodell requested review from zhammer and bbckr January 7, 2025 15:07
@colinodell colinodell self-assigned this Jan 7, 2025
Copy link
Contributor

@bbckr bbckr left a comment

Choose a reason for hiding this comment

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

Surprised we din't already have that, great change!

Copy link

codecov bot commented Jan 7, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 77.75%. Comparing base (9b58328) to head (b78755e).
Report is 1 commits behind head on main.

✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #38      +/-   ##
==========================================
+ Coverage   77.54%   77.75%   +0.20%     
==========================================
  Files          20       20              
  Lines         971      980       +9     
==========================================
+ Hits          753      762       +9     
  Misses        205      205              
  Partials       13       13              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@colinodell colinodell merged commit cac130a into main Jan 7, 2025
8 checks passed
@colinodell colinodell deleted the user-store-mutex branch January 7, 2025 15:22
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.

2 participants