Skip to content

Commit

Permalink
only handle session updates if the candidate itself is still in the r…
Browse files Browse the repository at this point in the history
…unning.
  • Loading branch information
dcarbone committed Nov 8, 2018
1 parent 780ea0c commit 0060f47
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions candidate/candidate.go
Original file line number Diff line number Diff line change
Expand Up @@ -503,6 +503,10 @@ Locker:

// sessionUpdate is the receiver for the session update callback
func (c *Candidate) sessionUpdate(update session.Update) {
if !c.Running() {
c.log.Printf("sessionUpdate() - Not in the running but received update: %v", update)
return
}
c.mu.RLock()
if c.session.ID() != update.ID {
c.mu.RUnlock()
Expand Down

0 comments on commit 0060f47

Please sign in to comment.