Skip to content

Commit

Permalink
Handle timer stop race in agent connectivity check loop
Browse files Browse the repository at this point in the history
  • Loading branch information
paulwe committed Apr 16, 2024
1 parent 0062167 commit 3fb852e
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 @@ -400,7 +400,9 @@ func (a *Agent) connectivityChecks() {

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

Check warning on line 404 in agent.go

View check run for this annotation

Codecov / codecov/patch

agent.go#L404

Added line #L404 was not covered by tests
}
contact()
case <-t.C:
contact()
Expand Down

0 comments on commit 3fb852e

Please sign in to comment.