Skip to content

Commit

Permalink
Take the account session lock when deleting from map
Browse files Browse the repository at this point in the history
  • Loading branch information
neilalexander committed Jun 13, 2023
1 parent 3b07f43 commit 9fe220f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions server/mqtt.go
Expand Up @@ -3319,8 +3319,10 @@ func (s *Server) mqttCheckPubRetainedPerms() {
// Not present or permissions have changed such that the source can't
// publish on that subject anymore: remove it from the map.
if u == nil {
asm.mu.Lock()
delete(asm.retmsgs, rf.subj)
asm.sl.Remove(rf.rmsg.sub)
asm.mu.Unlock()
deletes[rf.subj] = rf.rmsg.sseq
}
}
Expand Down

0 comments on commit 9fe220f

Please sign in to comment.