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

This commit is contained in:
Ethan Buchman
2016-03-03 06:18:32 +00:00
parent 05af306a8d
commit 085b3bc1f2
2 changed files with 2 additions and 2 deletions

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()
}
}

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()