Skip to content

Commit

Permalink
[FIXED] Fix for a datarace with stream stop and removal from jsa.stre…
Browse files Browse the repository at this point in the history
…ams. (#4963)


![image](https://github.com/nats-io/nats-server/assets/90097/404fdd28-2379-42cc-a7d5-dee22222cc9d)

Signed-off-by: Derek Collison <derek@nats.io>
  • Loading branch information
derekcollison authored Jan 16, 2024
2 parents d60dd74 + 782aeba commit df62353
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions server/jetstream_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -1123,6 +1123,7 @@ func (js *jetStream) checkForOrphans() {

for accName, jsa := range js.accounts {
asa := cc.streams[accName]
jsa.mu.RLock()
for stream, mset := range jsa.streams {
if sa := asa[stream]; sa == nil {
streams = append(streams, mset)
Expand All @@ -1136,6 +1137,7 @@ func (js *jetStream) checkForOrphans() {
}
}
}
jsa.mu.RUnlock()
}
js.mu.Unlock()

Expand Down

0 comments on commit df62353

Please sign in to comment.