Skip to content

Commit

Permalink
Revert "cache/dynacache: Prevent multiple concurrent resizes"
Browse files Browse the repository at this point in the history
This reverts commit 564bae0.

Thinking about it, the above doesn't make any sense/having any effect.
  • Loading branch information
bep committed Feb 23, 2024
1 parent 564bae0 commit 7ee0f70
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions cache/dynacache/dynacache.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,7 @@ func (o OptionsPartition) CalculateMaxSize(maxSizePerPartition int) int {

// A dynamic partitioned cache.
type Cache struct {
mu sync.RWMutex
resizeMu sync.Mutex
mu sync.RWMutex

partitions map[string]PartitionManager

Expand Down Expand Up @@ -232,12 +231,6 @@ func (c *Cache) Stop() {
}

func (c *Cache) adjustCurrentMaxSize() {
if !c.resizeMu.TryLock() {
// Prevent multiple concurrent resizes.
return
}
defer c.resizeMu.Unlock()

c.mu.RLock()
defer c.mu.RUnlock()

Expand Down

0 comments on commit 7ee0f70

Please sign in to comment.