mirror of
https://github.com/gogrlx/nats-server.git
synced 2026-04-17 11:24:44 -07:00
Merge pull request #2419 from nats-io/consumer-panic-stream-delete
[FIXED] #2416
This commit is contained in:
@@ -452,6 +452,10 @@ func (mset *stream) addConsumerWithAssignment(config *ConsumerConfig, oname stri
|
||||
|
||||
// Hold mset lock here.
|
||||
mset.mu.Lock()
|
||||
if mset.client == nil || mset.store == nil {
|
||||
mset.mu.Unlock()
|
||||
return nil, errors.New("invalid stream")
|
||||
}
|
||||
|
||||
// If this one is durable and already exists, we let that be ok as long as the configs match.
|
||||
if isDurableConsumer(config) {
|
||||
|
||||
@@ -964,7 +964,7 @@ func (mset *stream) purge(preq *JSApiStreamPurgeRequest) (purged uint64, err err
|
||||
mset.mu.Lock()
|
||||
if mset.client == nil {
|
||||
mset.mu.Unlock()
|
||||
return 0, errors.New("stream closed")
|
||||
return 0, errors.New("invalid stream")
|
||||
}
|
||||
// Purge dedupe.
|
||||
mset.ddmap = nil
|
||||
@@ -3324,7 +3324,7 @@ func (mset *stream) snapshot(deadline time.Duration, checkMsgs, includeConsumers
|
||||
mset.mu.RLock()
|
||||
if mset.client == nil || mset.store == nil {
|
||||
mset.mu.RUnlock()
|
||||
return nil, fmt.Errorf("invalid stream")
|
||||
return nil, errors.New("invalid stream")
|
||||
}
|
||||
store := mset.store
|
||||
mset.mu.RUnlock()
|
||||
|
||||
Reference in New Issue
Block a user