Merge pull request #2655 from nats-io/st-race

Race around accessing storage type
This commit is contained in:
Derek Collison
2021-10-28 12:41:25 -07:00
committed by GitHub

View File

@@ -4867,7 +4867,10 @@ func (mset *stream) processCatchupMsg(msg []byte) (uint64, error) {
return 0, errors.New("bad catchup msg")
}
mset.mu.RLock()
st := mset.cfg.Storage
mset.mu.RUnlock()
if mset.js.limitsExceeded(st) || mset.jsa.limitsExceeded(st) {
return 0, NewJSInsufficientResourcesError()
}