Fix data race condition

Signed-off-by: Derek Collison <derek@nats.io>
This commit is contained in:
Derek Collison
2021-06-18 07:47:19 -07:00
parent 36f2dbed8b
commit e7fd6961d6

View File

@@ -1837,7 +1837,9 @@ func (mset *stream) processSourceMsgs(si *sourceInfo) {
mset.mu.RUnlock()
// No longer leader.
if !isLeader {
mset.mu.Lock()
mset.cancelSourceConsumer(iname)
mset.mu.Unlock()
return
}
// We are stalled.