Quiet race detector

Signed-off-by: Derek Collison <derek@nats.io>
This commit is contained in:
Derek Collison
2021-04-07 14:25:21 -07:00
parent 74a051e3a8
commit 1b5f0edbab

View File

@@ -875,7 +875,11 @@ func (fs *fileStore) newMsgBlockForWrite() (*msgBlock, error) {
}
mb := &msgBlock{fs: fs, index: index, cexp: fs.fcfg.CacheExpire}
// Lock should be held to quiet race detector.
mb.mu.Lock()
mb.setupWriteCache(mbuf)
mb.mu.Unlock()
// Now do local hash.
key := sha256.Sum256(fs.hashKeyForBlock(index))