Browse Source

log stack trace on consensus failure

pull/697/head
Ethan Buchman 7 years ago
parent
commit
8c6bd44929
2 changed files with 3 additions and 2 deletions
  1. +1
    -1
      blockchain/reactor.go
  2. +2
    -1
      consensus/state.go

+ 1
- 1
blockchain/reactor.go View File

@ -235,7 +235,7 @@ FOR_LOOP:
err := bcR.state.Validators.VerifyCommit( err := bcR.state.Validators.VerifyCommit(
bcR.state.ChainID, types.BlockID{first.Hash(), firstPartsHeader}, first.Height, second.LastCommit) bcR.state.ChainID, types.BlockID{first.Hash(), firstPartsHeader}, first.Height, second.LastCommit)
if err != nil { if err != nil {
bcR.Logger.Info("error in validation", "err", err)
bcR.Logger.Error("Error in validation", "err", err)
bcR.pool.RedoRequest(first.Height) bcR.pool.RedoRequest(first.Height)
break SYNC_LOOP break SYNC_LOOP
} else { } else {


+ 2
- 1
consensus/state.go View File

@ -6,6 +6,7 @@ import (
"fmt" "fmt"
"path/filepath" "path/filepath"
"reflect" "reflect"
"runtime/debug"
"sync" "sync"
"time" "time"
@ -609,7 +610,7 @@ func (cs *ConsensusState) newStep() {
func (cs *ConsensusState) receiveRoutine(maxSteps int) { func (cs *ConsensusState) receiveRoutine(maxSteps int) {
defer func() { defer func() {
if r := recover(); r != nil { if r := recover(); r != nil {
cs.Logger.Error("CONSENSUS FAILURE!!!", "err", r)
cs.Logger.Error("CONSENSUS FAILURE!!!", "err", r, "stack", string(debug.Stack()))
} }
}() }()


Loading…
Cancel
Save