Skip to content
Snippets Groups Projects
Commit 6354f260 authored by benjamin's avatar benjamin
Browse files

minor clean up

parent c2fccb8a
No related branches found
No related tags found
4 merge requests!510Release,!419rewrote the health tracker to both consider if there are waiting rounds and...,!407rewrote the health tracker to both consider if there are waiting rounds and...,!340Project/channels
......@@ -164,10 +164,18 @@ func (t *tracker) StartProcesses() (stoppable.Stoppable, error) {
// health.
func (t *tracker) start(stop *stoppable.Single) {
// ensures wasHealthy is only set once
hasSetWasHealthy := false
// denotation of the previous state in order to catch state changes
lastState := false
// flag denoting required exit, allows final signaling
quit := false
//ensured the timeout error is only printed once per timeout period
timedOut := true
for {
/* wait for an event */
......@@ -181,9 +189,14 @@ func (t *tracker) start(stop *stoppable.Single) {
case heartbeat := <-t.heartbeat:
t.updateHealth(heartbeat.HasWaitingRound, heartbeat.IsRoundComplete)
timedOut = false
case <-time.After(t.timeout):
if !timedOut {
jww.ERROR.Printf("Network health tracker timed out, network " +
"is no longer healthy, follower likely has stopped...")
}
timedOut = true
// note: no need to force to unhealthy because by definition the
// timestamps will be stale
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment