Race around accessing storage type

Signed-off-by: Derek Collison <derek@nats.io>
This commit is contained in:
Derek Collison
2021-10-28 12:36:01 -07:00
parent 22fb95fcc5
commit cf5322088d

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()
}