nats-io / nats-server

High-Performance server for NATS.io, the cloud and edge native messaging system.
https://nats.io
Apache License 2.0
16k stars 1.41k forks source link

[FIXED] `mset.noInterest` requires write lock #6122

Closed MauriceVanVeen closed 1 week ago

MauriceVanVeen commented 1 week ago

mset.noInterest(..) mentions it requires a write lock to be held:

// Check if there is no interest in this sequence number across our consumers.
// The consumer passed is optional if we are processing the ack for that consumer.
// Write lock should be held.
func (mset *stream) noInterest(seq uint64, obs *consumer) bool {
    return !mset.checkForInterest(seq, obs)
}

This wasn't done in cleanupNoInterestMessages.

Signed-off-by: Maurice van Veen github@mauricevanveen.com