diff --git a/candidate/candidate.go b/candidate/candidate.go index cf144d4..cae16bb 100644 --- a/candidate/candidate.go +++ b/candidate/candidate.go @@ -477,7 +477,6 @@ acquisition: c.log.Print("Session Update: 2 successive errors seen, will construct new session") c.session.Stop() elected = false - updated = c.elected != nil && *c.elected != elected c.session = nil } } else if sessionUpdate.State == session.StateStopped { @@ -485,7 +484,6 @@ acquisition: sessionErrorsSeen = 0 elected = false - updated = c.elected != nil && *c.elected != elected c.log.Printf("Session Update: Stopped state seen (%d in row): %#v", sessionStoppedUpdatesSeen, sessionUpdate) @@ -502,6 +500,8 @@ acquisition: c.log.Debugf("Session Update: Received %#v", sessionUpdate) } + updated = c.elected != nil && *c.elected != elected + c.mu.Unlock() case resigned = <-c.resign: