Skip to content

Commit

Permalink
Close balloon store when everything else is closed
Browse files Browse the repository at this point in the history
Former-commit-id: 87e396f [formerly bf17b3d]
Former-commit-id: e466f5e
  • Loading branch information
gdiazlo committed Feb 26, 2019
1 parent 90c5743 commit 796e7f3
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions raftwal/raft.go
Original file line number Diff line number Diff line change
Expand Up @@ -214,12 +214,6 @@ func (b *RaftBalloon) Close(wait bool) error {
close(b.done)
b.wg.Wait()

// close database
if err := b.store.db.Close(); err != nil {
return err
}
b.store.db = nil

// shutdown raft
if b.raft.api != nil {
f := b.raft.api.Shutdown()
Expand All @@ -238,12 +232,19 @@ func (b *RaftBalloon) Close(wait bool) error {
if err := b.store.stable.Close(); err != nil {
return err
}

b.store.log = nil
b.store.stable = nil

// Close FSM
b.fsm.Close()

// close database
if err := b.store.db.Close(); err != nil {
return err
}
b.store.db = nil

return nil
}

Expand Down

0 comments on commit 796e7f3

Please sign in to comment.