From 9ea9e3015b9d47de11ed85cd9c5e28cba80c830b Mon Sep 17 00:00:00 2001 From: Daniel Paul Carbone Date: Wed, 1 Aug 2018 15:48:19 -0500 Subject: [PATCH] little bit of cleanup on candidate lock runner --- candidate/candidate.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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: