Skip to content

Bugfix/exclusive map access#117

Merged
travisbcotton merged 3 commits into
mainfrom
bugfix/exclusive-map-access
Jul 9, 2026
Merged

Bugfix/exclusive map access#117
travisbcotton merged 3 commits into
mainfrom
bugfix/exclusive-map-access

Conversation

@alexlovelltroy

@alexlovelltroy alexlovelltroy commented Jul 8, 2026

Copy link
Copy Markdown
Member

Description

This pull request improves concurrency safety in the in-memory CI store implementation by switching from read locks to write locks for all group and instance mutation methods. It also adds comprehensive tests to ensure thread safety under concurrent access scenarios.

Thread safety improvements:

  • Updated all mutation methods in MemStore (AddGroupData, UpdateGroupData, RemoveGroupData, SetInstanceInfo, DeleteInstanceInfo) to use Lock/Unlock instead of RLock/RUnlock on their respective mutexes, ensuring exclusive access during writes and preventing data races. [1] [2] [3] [4] [5]

Testing enhancements:

  • Added a new test TestConcurrentInstanceAccess in ciMemStore_test.go to verify correct behavior of the store under concurrent reads, writes, and mixed access patterns, helping to catch potential concurrency bugs.
  • Imported the sync package to support goroutine synchronization in the new concurrency tests.

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update

For more info, see Contributing Guidelines.

Signed-off-by: Alex Lovell-Troy <alovelltroy@lanl.gov>
…d DeleteInstanceInfo methods

test: add concurrent access tests for instance information in MemStore

Signed-off-by: Alex Lovell-Troy <alovelltroy@lanl.gov>
Signed-off-by: Alex Lovell-Troy <alovelltroy@lanl.gov>
@travisbcotton travisbcotton merged commit b67e9bc into main Jul 9, 2026
5 checks passed
@synackd synackd deleted the bugfix/exclusive-map-access branch July 9, 2026 19:27
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