Skip to content

Commit

Permalink
Check for n.Raft() to be nil, fixes #4053
Browse files Browse the repository at this point in the history
  • Loading branch information
mangalaman93 committed Oct 2, 2019
1 parent 051203a commit a0793b9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion worker/snapshot.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,9 +161,10 @@ func doStreamSnapshot(snap *pb.Snapshot, out pb.Worker_StreamSnapshotServer) err

func (w *grpcWorker) StreamSnapshot(stream pb.Worker_StreamSnapshotServer) error {
n := groups().Node
if n == nil {
if n == nil || n.Raft() == nil {
return conn.ErrNoNode
}

// Indicate that we're streaming right now. Used to cancel
// calculateSnapshot. However, this logic isn't foolproof. A leader might
// have already proposed a snapshot, which it can apply while this streaming
Expand Down

0 comments on commit a0793b9

Please sign in to comment.