Skip to content

Commit

Permalink
keybase_service_base: fix map delete under a read lock
Browse files Browse the repository at this point in the history
HOTPOT-2598
  • Loading branch information
strib committed May 7, 2020
1 parent 89219d9 commit bb8a527
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions go/kbfs/libkbfs/keybase_service_base.go
Original file line number Diff line number Diff line change
Expand Up @@ -300,8 +300,10 @@ func (k *KeybaseServiceBase) setCachedTeamInfo(

func (k *KeybaseServiceBase) getCachedNotWriter(
tid keybase1.TeamID, uid keybase1.UID) (notWriter bool) {
k.teamCacheLock.RLock()
defer k.teamCacheLock.RUnlock()
// Full write lock because of the delete-after-expiration code
// below.
k.teamCacheLock.Lock()
defer k.teamCacheLock.Unlock()
cachedTime, notWriter := k.notWriterCache[tid][uid]
if !notWriter {
return false
Expand Down

0 comments on commit bb8a527

Please sign in to comment.