Skip to content

Commit 0060f47

Browse files
committed
only handle session updates if the candidate itself is still in the running.
1 parent 780ea0c commit 0060f47

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

candidate/candidate.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -503,6 +503,10 @@ Locker:
503503

504504
// sessionUpdate is the receiver for the session update callback
505505
func (c *Candidate) sessionUpdate(update session.Update) {
506+
if !c.Running() {
507+
c.log.Printf("sessionUpdate() - Not in the running but received update: %v", update)
508+
return
509+
}
506510
c.mu.RLock()
507511
if c.session.ID() != update.ID {
508512
c.mu.RUnlock()

0 commit comments

Comments
 (0)