Skip to content

Commit

Permalink
[FIXED] mset.noInterest requires write lock
Browse files Browse the repository at this point in the history
Signed-off-by: Maurice van Veen <github@mauricevanveen.com>
  • Loading branch information
MauriceVanVeen authored and neilalexander committed Nov 14, 2024
1 parent b20c43e commit d867482
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion server/consumer.go
Original file line number Diff line number Diff line change
Expand Up @@ -5332,12 +5332,14 @@ func (o *consumer) cleanupNoInterestMessages(mset *stream, ignoreInterest bool)
return
}

mset.mu.RUnlock()
mset.mu.Lock()
for seq := start; seq <= stop; seq++ {
if mset.noInterest(seq, co) {
rmseqs = append(rmseqs, seq)
}
}
mset.mu.RUnlock()
mset.mu.Unlock()

// These can be removed.
for _, seq := range rmseqs {
Expand Down

0 comments on commit d867482

Please sign in to comment.