Skip to content

Commit

Permalink
Handle timer stop race in agent connectivity check (#677)
Browse files Browse the repository at this point in the history
  • Loading branch information
paulwe committed Apr 16, 2024
1 parent 675c8ba commit eb30993
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,9 @@ func (a *Agent) connectivityChecks() {

select {
case <-a.forceCandidateContact:
t.Stop()
if !t.Stop() {
<-t.C
}
contact()
case <-t.C:
contact()
Expand Down

0 comments on commit eb30993

Please sign in to comment.