Skip to content

Commit

Permalink
Merge pull request #16734 from wallyworld/racefix-fix
Browse files Browse the repository at this point in the history
#16734

#16732 fixed a race failure but there was a small mistake in calling unlock.

## QA steps

run unit tests
  • Loading branch information
jujubot committed Jan 4, 2024
2 parents 4acafa2 + 42e6f08 commit 92a5cac
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/cache/resident.go
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@ func (r *Resident) CacheId() uint64 {
func (r *Resident) registerWorker(w worker.Worker) func() {
id := r.nextResourceId()
r.mu.Lock()
defer r.mu.Unlock()
// If this resident is already being evicted
// don't register any new workers.
if r.evicting {
Expand All @@ -242,7 +243,6 @@ func (r *Resident) registerWorker(w worker.Worker) func() {
}
}
r.workers[id] = w
r.mu.Unlock()
return func() { r.deregisterWorker(id) }
}

Expand Down

0 comments on commit 92a5cac

Please sign in to comment.