Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
小 白蛋
Vault
Commits
08c83d34
Unverified
Commit
08c83d34
authored
4 years ago
by
Alexander Bezobchuk
Committed by
GitHub
4 years ago
Browse files
Options
Download
Email Patches
Plain Diff
physical/raft: Add nil check to shutdown (#9322)
parent
26177d22
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
physical/raft/raft.go
+13
-2
physical/raft/raft.go
with
13 additions
and
2 deletions
+13
-2
physical/raft/raft.go
+
13
-
2
View file @
08c83d34
...
...
@@ -729,14 +729,25 @@ func (b *RaftBackend) TeardownCluster(clusterListener cluster.ClusterHook) error
}
b
.
l
.
Lock
()
future
:=
b
.
raft
.
Shutdown
()
// Perform shutdown only if the raft object is non-nil. The object could be nil
// if the node is unsealed but has not joined the peer set.
var
future
raft
.
Future
if
b
.
raft
!=
nil
{
future
=
b
.
raft
.
Shutdown
()
}
b
.
raft
=
nil
// If we're tearing down, then we need to recreate the raftInitCh
b
.
raftInitCh
=
make
(
chan
struct
{})
b
.
l
.
Unlock
()
return
future
.
Error
()
if
future
!=
nil
{
return
future
.
Error
()
}
return
nil
}
// CommittedIndex returns the latest index committed to stable storage
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Projects
Groups
Snippets
Help