From 4c5a143a70c804126fe169e44ebf2bdd95fd8a5f Mon Sep 17 00:00:00 2001 From: Anton Kaliaev Date: Thu, 2 Aug 2018 16:36:28 +0400 Subject: [PATCH] respawn receiveRoutine so we can properly exit Closes #2072 --- consensus/state.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/consensus/state.go b/consensus/state.go index f66a872eb..435427a91 100644 --- a/consensus/state.go +++ b/consensus/state.go @@ -556,6 +556,7 @@ func (cs *ConsensusState) receiveRoutine(maxSteps int) { defer func() { if r := recover(); r != nil { cs.Logger.Error("CONSENSUS FAILURE!!!", "err", r, "stack", string(debug.Stack())) + go cs.receiveRoutine(0) } }() @@ -588,7 +589,6 @@ func (cs *ConsensusState) receiveRoutine(maxSteps int) { // go to the next step cs.handleTimeout(ti, rs) case <-cs.Quit(): - // NOTE: the internalMsgQueue may have signed messages from our // priv_val that haven't hit the WAL, but its ok because // priv_val tracks LastSig