Skip to content

Commit

Permalink
Merge #92606
Browse files Browse the repository at this point in the history
92606: config: acquire write lock when overwriting the map r=yuzefovich a=yuzefovich

Previously, by mistake we were acquiring a read lock even though we do write operations in `PurgeZoneConfigCache`.

Fixes: #92519.

Release note: None

Co-authored-by: Yahor Yuzefovich <[email protected]>
  • Loading branch information
craig[bot] and yuzefovich committed Nov 29, 2022
2 parents 305b01e + a69ffb5 commit 5632043
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/config/system.go
Original file line number Diff line number Diff line change
Expand Up @@ -408,8 +408,8 @@ func (s *SystemConfig) GetZoneConfigForObject(
// requested. Note, this function is only intended to be called during test
// execution, such as logic tests.
func (s *SystemConfig) PurgeZoneConfigCache() {
s.mu.RLock()
defer s.mu.RUnlock()
s.mu.Lock()
defer s.mu.Unlock()
if len(s.mu.zoneCache) != 0 {
s.mu.zoneCache = map[ObjectID]zoneEntry{}
}
Expand Down

0 comments on commit 5632043

Please sign in to comment.