Browse Source

consensus: don't wait for wal if conS not running

pull/192/head
Ethan Buchman 9 years ago
parent
commit
085b3bc1f2
2 changed files with 2 additions and 2 deletions
  1. +1
    -1
      consensus/state.go
  2. +1
    -1
      consensus/wal.go

+ 1
- 1
consensus/state.go View File

@ -319,7 +319,7 @@ func (cs *ConsensusState) startRoutines(maxSteps int) {
func (cs *ConsensusState) OnStop() {
cs.QuitService.OnStop()
if cs.wal != nil {
if cs.wal != nil && cs.IsRunning() {
cs.wal.Wait()
}
}


+ 1
- 1
consensus/wal.go View File

@ -80,7 +80,7 @@ func (wal *WAL) Save(msg ConsensusLogMessageInterface) {
}
}
// Must not be called concurrently.
// Must not be called concurrently with a write.
func (wal *WAL) Close() {
if wal != nil {
wal.fp.Close()


Loading…
Cancel
Save