Skip to content

Commit

Permalink
Fix data race
Browse files Browse the repository at this point in the history
Signed-off-by: Derek Collison <derek@nats.io>
  • Loading branch information
derekcollison committed Jul 7, 2022
1 parent be789c6 commit c49d081
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion server/jetstream_cluster.go
Expand Up @@ -703,7 +703,10 @@ func (s *Server) JetStreamIsStreamAssigned(account, stream string) bool {
if acc == nil {
return false
}
return cc.isStreamAssigned(acc, stream)
js.mu.RLock()
assigned := cc.isStreamAssigned(acc, stream)
js.mu.RUnlock()
return assigned
}

// streamAssigned informs us if this server has this stream assigned.
Expand Down

0 comments on commit c49d081

Please sign in to comment.