Skip to content

Conversation

SungJin1212
Copy link
Member

I have noticed the TestCachedScanner_ConcurrentAccess is flaky. The reason is that two goroutines get the RLock and call ScanUsers. This PR changes to use Rock to avoid concurrent access when there is a need to update the cache.

--- FAIL: TestCachedScanner_ConcurrentAccess (0.00s)
    cache_test.go:153: 
        	Error Trace:	/__w/cortex/cortex/pkg/storage/tsdb/users/cache_test.go:153
        	Error:      	Not equal: 
        	            	expected: 1
        	            	actual  : 2
        	Test:       	TestCachedScanner_ConcurrentAccess
FAIL

Which issue(s) this PR fixes:
Fixes #

Checklist

  • Tests updated
  • Documentation added
  • CHANGELOG.md updated - the order of entries should be [CHANGE], [FEATURE], [ENHANCEMENT], [BUGFIX]

Copy link
Contributor

@yeya24 yeya24 left a comment

Choose a reason for hiding this comment

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

Thanks!

@yeya24 yeya24 merged commit 8cedb94 into cortexproject:master Jul 15, 2025
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants