Skip to content

Commit cf407e4

Browse files
authored
Fix race condition in active user (#6773)
1 parent 7769647 commit cf407e4

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
* [BUGFIX] Query Frontend: Fix query frontend per `user` metrics clean up. #6698
4747
* [BUGFIX] Add `__markers__` tenant ID validation. #6761
4848
* [BUGFIX] Ring: Fix nil pointer exception when token is shared. #6768
49+
* [BUGFIX] Fix race condition in active user. #6773
4950

5051
## 1.19.0 2025-02-27
5152

pkg/util/active_user.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,8 @@ func (m *ActiveUsers) PurgeInactiveUsers(deadline int64) []string {
9595
}
9696

9797
func (m *ActiveUsers) ActiveUsers(deadline int64) []string {
98-
active := make([]string, 0, len(m.timestamps))
9998
m.mu.RLock()
99+
active := make([]string, 0, len(m.timestamps))
100100
defer m.mu.RUnlock()
101101
for userID, ts := range m.timestamps {
102102
if ts.Load() > deadline {

0 commit comments

Comments
 (0)