Skip to content

Commit

Permalink
Fix possible panic on monitorStream when shutting down
Browse files Browse the repository at this point in the history
Signed-off-by: Waldemar Quevedo <wally@nats.io>
  • Loading branch information
wallyqs authored and neilalexander committed Oct 16, 2024
1 parent 179805f commit c4f3251
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion server/jetstream_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -2266,7 +2266,7 @@ func (js *jetStream) monitorStream(mset *stream, sa *streamAssignment, sendSnaps
// from underneath the one that is running since it will be the same raft node.
defer func() {
// We might be closing during shutdown, don't pre-emptively stop here since we'll still want to install snapshots.
if !mset.closed.Load() {
if mset != nil && !mset.closed.Load() {
n.Stop()
}
}()
Expand Down

0 comments on commit c4f3251

Please sign in to comment.